mirror of
https://github.com/jazzband/django-admin2.git
synced 2026-03-17 14:40:27 +00:00
15 lines
306 B
Python
15 lines
306 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')
|
|
|
|
admin.site.register(Post, PostAdmin)
|
|
admin.site.register(Comment)
|