From 6aaa192382b1a17cea5d0de7e7925d39792e1dbd Mon Sep 17 00:00:00 2001 From: Johnson Chetty Date: Fri, 12 Apr 2013 21:37:45 +0200 Subject: [PATCH] get_dict for events --- itf/events/models.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/itf/events/models.py b/itf/events/models.py index 478e779..0b43b53 100644 --- a/itf/events/models.py +++ b/itf/events/models.py @@ -84,10 +84,17 @@ class Event(ItfModel): 'buzzitems': [ obj for obj in self.buzzitems.all()], 'groups': [obj for obj in self.groupevent_set.all()], 'galleries': [obj for obj in self.galleries.all()], - + 'child_events': self.child_events.all(), + 'parent':self.parent_event, } - if self.parent_event: - rdict['parent'] = self.parent_event + if self.groups.all(): + groups= { + 'venue': [ obj.group for obj in self.groupevent_set.filter(typ='venue')], + 'performing': [ obj.group for obj in self.groupevent_set.filter(typ='performing')] + } + rdict['groups']= groups + + if self.people.all(): people= { 'attendees': [ obj.person for obj in self.personevent_set.filter(typ='attendee')],