add PadmaClip generic to Session and Participant

This commit is contained in:
Sanj 2012-04-24 11:42:18 +05:30
parent a612e66b62
commit 2855f30636
2 changed files with 6 additions and 3 deletions

View File

@ -43,6 +43,7 @@ class MeetingDayInline(admin.StackedInline):
extra = 3
class ParticipantInline(admin.StackedInline):
inlines = [PadmaVideoInline]
model = Participant
extra = 3
@ -64,7 +65,7 @@ class ProjectAdmin(admin.ModelAdmin):
save_on_top = True
class SessionAdmin(admin.ModelAdmin):
# inlines = [PadmaVideoInline]
inlines = [PadmaVideoInline]
search_fields = ('title', 'intro',)
list_filter = ['day']
list_display = ('__unicode__',)

View File

@ -101,6 +101,7 @@ class Participant(ItfModel):
short_bio = models.TextField(max_length=255, blank=True, null=True)
meeting = models.ForeignKey('Meeting')
meetings = models.ManyToManyField('Meeting', related_name='participants')
videos = generic.GenericRelation(PadmaVideo)
fts_fields = ['name', 'title', 'short_bio']
def __unicode__(self):
@ -152,7 +153,7 @@ class Session(models.Model):
intro = models.TextField(blank=True, null=True)
day = models.ForeignKey('MeetingDay')
session_no = models.IntegerField(blank=True, null=True)
# videos = generic.GenericRelation(PadmaVideo)
videos = generic.GenericRelation(PadmaClip)
def __unicode__(self):
return "%s - %s" % (self.day.meeting.title, self.title) # name of meeting - name of session
@ -162,7 +163,8 @@ class Session(models.Model):
'title': self.title,
'intro': self.intro,
'session_no': self.session_no,
'talks': [t.get_dict() for t in self.talk_set.all()]
'talks': [t.get_dict() for t in self.talk_set.all()],
'videos': self.video_set.all()
}