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
|
|
|
|
2015-01-28 12:35:27 +00:00
|
|
|
from .models import (
|
|
|
|
Category, Contact, Episode, EpisodePermanent, Media, PhoneNumber,
|
|
|
|
)
|
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])
|