forgot to add erang admin.py
This commit is contained in:
parent
f44d21a424
commit
dc97b6df23
44
itf/erang/admin.py
Normal file
44
itf/erang/admin.py
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
from django.contrib import admin
|
||||||
|
from models import *
|
||||||
|
# from forms import ArticleForm
|
||||||
|
|
||||||
|
class ArticleInline(admin.StackedInline):
|
||||||
|
model = Article
|
||||||
|
extra = 4
|
||||||
|
filter_horizontal = ['authors']
|
||||||
|
|
||||||
|
class ImageInline(admin.StackedInline):
|
||||||
|
model = Image
|
||||||
|
extra = 4
|
||||||
|
|
||||||
|
class DocumentInline(admin.StackedInline):
|
||||||
|
model = Document
|
||||||
|
extra = 4
|
||||||
|
|
||||||
|
class IssueAdmin(admin.ModelAdmin):
|
||||||
|
list_display = ('name', 'date', 'published',)
|
||||||
|
inlines = [ArticleInline, ImageInline, DocumentInline]
|
||||||
|
save_on_top = True
|
||||||
|
|
||||||
|
class ContributorAdmin(admin.ModelAdmin):
|
||||||
|
pass
|
||||||
|
|
||||||
|
class DocumentAdmin(admin.ModelAdmin):
|
||||||
|
list_filter = ['issue']
|
||||||
|
search_fields = ('doc_txt',)
|
||||||
|
list_display = ('title', 'doc_txt',)
|
||||||
|
|
||||||
|
class ImageAdmin(admin.ModelAdmin):
|
||||||
|
list_filter = ['issue']
|
||||||
|
|
||||||
|
class ArticleAdmin(admin.ModelAdmin):
|
||||||
|
filter_horizontal = ['authors']
|
||||||
|
list_filter = ['issue']
|
||||||
|
# form = ArticleForm
|
||||||
|
|
||||||
|
admin.site.register(Issue, IssueAdmin)
|
||||||
|
admin.site.register(Article, ArticleAdmin)
|
||||||
|
admin.site.register(Document, DocumentAdmin)
|
||||||
|
admin.site.register(Contributor, ContributorAdmin)
|
||||||
|
admin.site.register(Image, ImageAdmin)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user