Merge pull request #200 from bornhack/fix_admin_for_info
Fix admin for Info.
This commit is contained in:
commit
caa8856f72
|
@ -1,6 +1,22 @@
|
||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
from .models import *
|
from .models import *
|
||||||
|
|
||||||
admin.site.register(InfoCategory)
|
|
||||||
admin.site.register(InfoItem)
|
|
||||||
|
|
||||||
|
@admin.register(InfoItem)
|
||||||
|
class InfoItemAdmin(admin.ModelAdmin):
|
||||||
|
list_filter = ['category', 'category__camp',]
|
||||||
|
list_display = ['headline',]
|
||||||
|
|
||||||
|
|
||||||
|
class InfoItemInlineAdmin(admin.StackedInline):
|
||||||
|
model = InfoItem
|
||||||
|
list_filter = ['category', 'category__camp',]
|
||||||
|
list_display = ['headline',]
|
||||||
|
|
||||||
|
|
||||||
|
@admin.register(InfoCategory)
|
||||||
|
class InfoCategorydmin(admin.ModelAdmin):
|
||||||
|
list_filter = ['camp',]
|
||||||
|
list_display = ['headline',]
|
||||||
|
search_fields = ['headline', 'body']
|
||||||
|
inlines = [InfoItemInlineAdmin]
|
||||||
|
|
Loading…
Reference in a new issue