khaganat-web/navbar/admin.py

12 lines
303 B
Python
Raw Normal View History

2018-01-21 12:44:00 +00:00
from django.contrib import admin
from .models import Element,ElementDescription
class ElementDescriptionInline(admin.StackedInline):
model = ElementDescription
extra = 2
class ElementAdmin(admin.ModelAdmin):
inlines = [ElementDescriptionInline]
admin.site.register(Element, ElementAdmin)