2015-12-27 01:46:51 +08:00
|
|
|
from django.contrib import admin
|
|
|
|
|
2015-12-27 02:51:22 +08:00
|
|
|
from .models import Article, ArticleProxy, Site
|
|
|
|
|
|
|
|
|
|
|
|
class ArticleInline(admin.TabularInline):
|
|
|
|
model = Article
|
|
|
|
fields = ['title']
|
|
|
|
|
|
|
|
|
|
|
|
class SiteAdmin(admin.ModelAdmin):
|
|
|
|
inlines = [ArticleInline]
|
|
|
|
|
2015-12-27 01:46:51 +08:00
|
|
|
|
|
|
|
site = admin.AdminSite(name='admin')
|
|
|
|
site.register(Article)
|
|
|
|
site.register(ArticleProxy)
|
2015-12-27 02:51:22 +08:00
|
|
|
site.register(Site, SiteAdmin)
|