add document subject stuff
This commit is contained in:
parent
64756a1e58
commit
7384a183b1
|
@ -82,6 +82,7 @@ admin.site.register(Video, VideoAdmin)
|
||||||
admin.site.register(Image, ImageAdmin)
|
admin.site.register(Image, ImageAdmin)
|
||||||
admin.site.register(PadmaVideo, PadmaVideoAdmin)
|
admin.site.register(PadmaVideo, PadmaVideoAdmin)
|
||||||
admin.site.register(Document)
|
admin.site.register(Document)
|
||||||
|
admin.site.register(DocumentSubject)
|
||||||
admin.site.register(Project, ProjectAdmin)
|
admin.site.register(Project, ProjectAdmin)
|
||||||
#admin.site.register(MeetingDay)
|
#admin.site.register(MeetingDay)
|
||||||
admin.site.register(Session, SessionAdmin)
|
admin.site.register(Session, SessionAdmin)
|
||||||
|
|
|
@ -166,6 +166,28 @@ class Image(models.Model):
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return self.title
|
return self.title
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
class DocumentSubject(ItfModel):
|
||||||
|
title = models.CharField(max_length=255)
|
||||||
|
main_image = models.ImageField(upload_to='upload/images/festival/main/', blank=True, null=True)
|
||||||
|
|
||||||
|
def __unicode__(self):
|
||||||
|
return self.title
|
||||||
|
|
||||||
|
def list_dict(self):
|
||||||
|
return {
|
||||||
|
'id': self.id,
|
||||||
|
'title': self.title
|
||||||
|
}
|
||||||
|
|
||||||
|
def info_dict(self):
|
||||||
|
return {
|
||||||
|
'id': self.id,
|
||||||
|
'title': self.title,
|
||||||
|
'documents': [d.info_dict() for d in Document.objects.filter(subject=self)]
|
||||||
|
}
|
||||||
|
|
||||||
class Document(ItfModel):
|
class Document(ItfModel):
|
||||||
title = models.CharField(max_length=255)
|
title = models.CharField(max_length=255)
|
||||||
intro = RichTextField(blank=True, null=True)
|
intro = RichTextField(blank=True, null=True)
|
||||||
|
@ -173,7 +195,7 @@ class Document(ItfModel):
|
||||||
meeting = models.ForeignKey('Meeting', blank=True, null=True)
|
meeting = models.ForeignKey('Meeting', blank=True, null=True)
|
||||||
talk = models.ForeignKey('Talk', blank=True, null=True)
|
talk = models.ForeignKey('Talk', blank=True, null=True)
|
||||||
is_resource = models.BooleanField()
|
is_resource = models.BooleanField()
|
||||||
|
subject = models.ForeignKey('DocumentSubject', blank=True, null=True)
|
||||||
|
|
||||||
fts_fields = ['title', 'intro']
|
fts_fields = ['title', 'intro']
|
||||||
fk_filters = []
|
fk_filters = []
|
||||||
|
|
0
itf/templates/modules/festival/documentsubject.html
Normal file
0
itf/templates/modules/festival/documentsubject.html
Normal file
Loading…
Reference in New Issue
Block a user