mirror of
https://github.com/jazzband/django-admin2.git
synced 2026-03-17 06:30:25 +00:00
16 lines
348 B
Python
16 lines
348 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')
|
|
list_filter = ['published', 'title' ]
|
|
|
|
admin.site.register(Post, PostAdmin)
|
|
admin.site.register(Comment)
|