camp/content/admin.py

47 lines
1.2 KiB
Python
Raw Normal View History

2017-05-20 12:45:26 +00:00
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
# Register your models here.
from models import *
2017-06-10 11:07:32 +00:00
class ContentParentsInline(admin.TabularInline):
model = ContentContent
2017-06-10 12:05:37 +00:00
fk_name = 'contentid2'
class ImagesInline(admin.StackedInline):
model = Image
class FileInline(admin.StackedInline):
model = File
class LinkInline(admin.StackedInline):
model = Link
2017-05-20 12:45:26 +00:00
'''
class SubdomainInline(admin.StackedInline):
model = Subdomain
class DomainAliasInline(admin.StackedInline):
model = DomainAlias
class ServerAdmin(admin.ModelAdmin):
pass
'''
class ContentAdmin(admin.ModelAdmin):
save_on_top = True
2017-05-24 11:44:04 +00:00
list_display = ('__unicode__', 'datestart', 'type')
list_filter = ['datestart', 'type']
search_fields = ['title', 'body', 'header']
2017-06-10 12:05:37 +00:00
inlines = [ContentParentsInline, ImagesInline, FileInline, LinkInline]
2017-05-24 11:44:04 +00:00
2017-05-20 12:45:26 +00:00
# inlines = [SubdomainInline, DomainAliasInline]
# list_display = ('url', 'server', 'manage_nameserver', 'domain_registrar', 'email', 'is_active')
# list_editable = ('server', 'manage_nameserver', 'domain_registrar', 'email', 'is_active')
admin.site.register(Content, ContentAdmin)