From bbf9f4b19a2273a636f8c233347e4201122364f0 Mon Sep 17 00:00:00 2001 From: Sanj Date: Sat, 10 Sep 2011 08:05:18 +0530 Subject: [PATCH] add template for participants --- itf/festival/models.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/itf/festival/models.py b/itf/festival/models.py index f72504c..6ab1894 100644 --- a/itf/festival/models.py +++ b/itf/festival/models.py @@ -71,7 +71,7 @@ class Meeting(ItfModel): meeting_data['participants'] = Participant.objects.filter(meeting__id=meeting_id).order_by('name') return meeting_data -class Participant(models.Model): +class Participant(ItfModel): name = models.CharField(max_length=255) title = models.CharField(max_length=255, blank=True, null=True) short_bio = models.TextField(max_length=255, blank=True, null=True) @@ -80,6 +80,19 @@ class Participant(models.Model): def __unicode__(self): return self.name + def list_dict(self): + return { + 'id': self.id, + 'title': self.title + } + + def info_dict(self): + return { + 'id': self.id, + 'title': self.title, + 'short_bio': self.short_bio, + } + class Talk(models.Model): title = models.CharField(max_length=255) intro = models.TextField(blank=True, null=True)