addons-server/apps/blocklist/admin.py

21 строка
578 B
Python
Исходник Обычный вид История

2010-01-27 01:23:25 +03:00
from django.contrib import admin
from . import models
ms = models.BlocklistItem, models.BlocklistPlugin, models.BlocklistGfx
inlines = [type(cls.__name__ + 'Inline', (admin.StackedInline,),
{'model': cls})
for cls in ms]
class DetailAdmin(admin.ModelAdmin):
inlines = inlines
admin.site.register(models.BlocklistApp)
admin.site.register(models.BlocklistCA)
admin.site.register(models.BlocklistItem)
admin.site.register(models.BlocklistPlugin)
admin.site.register(models.BlocklistGfx)
admin.site.register(models.BlocklistDetail, DetailAdmin)