mirror of
https://github.com/jazzband/django-admin2.git
synced 2026-03-17 06:30:25 +00:00
18 lines
404 B
Python
18 lines
404 B
Python
from django.contrib import admin
|
|
|
|
from .models import Post, Comment
|
|
|
|
|
|
class CommentInline(admin.TabularInline):
|
|
model = Comment
|
|
|
|
|
|
class PostAdmin(admin.ModelAdmin):
|
|
inlines = [CommentInline, ]
|
|
search_fields = ('title', 'body', "published_date")
|
|
list_filter = ['published', 'title']
|
|
date_hierarchy = "published_date"
|
|
|
|
|
|
admin.site.register(Post, PostAdmin)
|
|
admin.site.register(Comment)
|