it/itf/festival/admin.py

93 lines
2.5 KiB
Python
Raw Normal View History

2010-03-03 14:28:00 +00:00
from django.contrib import admin
from models import *
class AudioInline(admin.StackedInline):
model = Audio
extra = 2
class ImageInline(admin.StackedInline):
model = Image
extra = 3
2010-05-14 02:33:11 +00:00
class PadmaVideoInline(admin.StackedInline):
model = PadmaVideo
extra = 3
2010-03-03 14:28:00 +00:00
class DocumentInline(admin.StackedInline):
model = Document
extra = 2
2010-05-14 02:33:11 +00:00
class PadmaVideoAdmin(admin.ModelAdmin):
pass
2010-03-03 14:28:00 +00:00
class TalkAdmin(admin.ModelAdmin):
2010-05-14 02:33:11 +00:00
inlines = [AudioInline, ImageInline, DocumentInline, PadmaVideoInline]
2010-03-03 14:28:00 +00:00
save_on_top = True
list_display = ('__unicode__', 'presenter', 'session',)
list_filter = ['session']
search_fields = ('title', 'intro', 'presenter',)
#hide meeting field
class MeetingDayInline(admin.StackedInline):
model = MeetingDay
extra = 3
class ParticipantInline(admin.StackedInline):
model = Participant
extra = 3
class MeetingAdmin(admin.ModelAdmin):
inlines = [MeetingDayInline, ImageInline, DocumentInline, ParticipantInline]
prepopulated_fields = {"slug": ("title",)}
save_on_top = True
class ProjectAdmin(admin.ModelAdmin):
prepopulated_fields = {"slug": ("title",)}
save_on_top = True
class SessionAdmin(admin.ModelAdmin):
search_fields = ('title', 'intro',)
list_filter = ['day']
list_display = ('__unicode__',)
class ParticipantAdmin(admin.ModelAdmin):
search_fields = ('title', 'short_bio',)
list_display = ('name', 'title', 'meeting',)
list_filter = ['meeting']
class CommentAdmin(admin.ModelAdmin):
list_display = ('__unicode__', 'is_displayed',)
list_editable = ('is_displayed',)
list_filter = ['meeting']
class SignupAdmin(admin.ModelAdmin):
search_fields = ('email',)
class ImageAdmin(admin.ModelAdmin):
search_fields = ('title', 'intro',)
list_filter = ['meeting', 'talk']
class AudioAdmin(admin.ModelAdmin):
search_fields = ('title', 'intro',)
list_filter = ['meeting', 'talk']
class VideoAdmin(admin.ModelAdmin):
search_fields = ('title', 'intro',)
list_filter = ['meeting', 'talk']
admin.site.register(Comment, CommentAdmin)
admin.site.register(Meeting, MeetingAdmin)
admin.site.register(Audio, AudioAdmin)
admin.site.register(Video, VideoAdmin)
2010-05-14 02:33:11 +00:00
admin.site.register(Image, ImageAdmin)
admin.site.register(PadmaVideo, PadmaVideoAdmin)
2011-11-23 16:04:21 +00:00
admin.site.register(Document)
admin.site.register(DocumentSubject)
2010-03-03 14:28:00 +00:00
admin.site.register(Project, ProjectAdmin)
#admin.site.register(MeetingDay)
admin.site.register(Session, SessionAdmin)
admin.site.register(Talk, TalkAdmin)
admin.site.register(Participant, ParticipantAdmin)
admin.site.register(Signup, SignupAdmin)
admin.site.register(CommentCaptcha)