1
0
mirror of https://github.com/django/django.git synced 2025-01-15 21:02:52 +00:00
Tim Graham a8b70d251d [1.8.x] Sorted imports with isort; refs #23860.
Backport of 0ed7d155635da9f79d4dd67e4889087d3673c6da from master
2015-02-09 14:24:06 -05:00

34 lines
722 B
Python

from django.contrib import admin
from django.contrib.contenttypes.admin import GenericTabularInline
from .models import (
Category, Contact, Episode, EpisodePermanent, Media, PhoneNumber,
)
site = admin.AdminSite(name="admin")
class MediaInline(GenericTabularInline):
model = Media
class EpisodeAdmin(admin.ModelAdmin):
inlines = [
MediaInline,
]
class PhoneNumberInline(GenericTabularInline):
model = PhoneNumber
class MediaPermanentInline(GenericTabularInline):
model = Media
can_delete = False
site.register(Episode, EpisodeAdmin)
site.register(Contact, inlines=[PhoneNumberInline])
site.register(Category)
site.register(EpisodePermanent, inlines=[MediaPermanentInline])