2011-09-20 18:16:49 +00:00
|
|
|
from django.contrib import admin
|
2014-01-22 06:43:33 +00:00
|
|
|
from django.contrib.contenttypes.admin import GenericTabularInline
|
2011-09-20 18:16:49 +00:00
|
|
|
|
2014-03-05 20:19:40 +00:00
|
|
|
from .models import (Media, PhoneNumber, Episode, Contact,
|
|
|
|
Category, EpisodePermanent)
|
2011-09-20 18:16:49 +00:00
|
|
|
|
2011-10-13 21:34:56 +00:00
|
|
|
|
2011-09-20 18:16:49 +00:00
|
|
|
site = admin.AdminSite(name="admin")
|
|
|
|
|
2013-11-03 04:36:09 +00:00
|
|
|
|
2014-01-22 06:43:33 +00:00
|
|
|
class MediaInline(GenericTabularInline):
|
2011-09-20 18:16:49 +00:00
|
|
|
model = Media
|
|
|
|
|
|
|
|
|
|
|
|
class EpisodeAdmin(admin.ModelAdmin):
|
|
|
|
inlines = [
|
|
|
|
MediaInline,
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2014-01-22 06:43:33 +00:00
|
|
|
class PhoneNumberInline(GenericTabularInline):
|
2011-09-20 18:16:49 +00:00
|
|
|
model = PhoneNumber
|
|
|
|
|
|
|
|
|
2014-01-22 06:43:33 +00:00
|
|
|
class MediaPermanentInline(GenericTabularInline):
|
2011-09-20 18:16:49 +00:00
|
|
|
model = Media
|
|
|
|
can_delete = False
|
|
|
|
|
|
|
|
|
|
|
|
site.register(Episode, EpisodeAdmin)
|
|
|
|
site.register(Contact, inlines=[PhoneNumberInline])
|
|
|
|
site.register(Category)
|
|
|
|
site.register(EpisodePermanent, inlines=[MediaPermanentInline])
|