add PadmaClip generic to Session and Participant
This commit is contained in:
parent
a612e66b62
commit
2855f30636
|
@ -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__',)
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user