Skip to content

Commit 6574f45

Browse files
committed
add related_projects to Event
1 parent f235cef commit 6574f45

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

anthill/events/forms.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ def compress(self, data_list):
3535
class EventForm(forms.ModelForm):
3636
class Meta:
3737
model = Event
38-
fields = ['title', 'description', 'location', 'url', 'start_date', 'end_date']
38+
fields = ['title', 'description', 'location', 'url', 'start_date', 'end_date', 'related_projects']
39+
3940
location = forms.CharField(label='Address')
4041
start_date = SplitDateOptionalTimeField(widget=SplitDateTimeListWidget, required=False)
4142
end_date = SplitDateOptionalTimeField(widget=SplitDateTimeListWidget, required=False)

anthill/events/models.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from django.db.models import Q
66
from django.conf import settings
77
from anthill.models import LocationModel, LocationModelManager
8+
from anthill.projects.models import Project
89
from markupfield.fields import MarkupField
910

1011
class EventManager(LocationModelManager):
@@ -22,6 +23,7 @@ class Event(LocationModel):
2223
end_date = models.DateTimeField(null=True, blank=True)
2324
creator = models.ForeignKey(User, related_name='events_created')
2425
attendees = models.ManyToManyField(User, through='Attendance', related_name='events_attended')
26+
related_projects = models.ManyToManyField(Project, related_name='related_events')
2527

2628
objects = EventManager()
2729

0 commit comments

Comments
 (0)