Created admin

parent c8815fb4
from django.contrib import admin from django.contrib import admin
from .models import ForumPost, Reply
# Register your models here. # Register your models here.
class ReplyInLine(admin.TabularInline):
model = Reply
extra = 1
class ForumPostAdmin(admin.ModelAdmin):
inlines = [ReplyInLine,]
list_display = ('author', 'title', 'pub_datetime', 'body')
search_fields = ('title', 'author', 'body')
list_filter = ('author', 'pub_datetime')
admin.site.register(ForumPost, ForumPostAdmin)
admin.site.register(Reply)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment