Commit 1265f324 authored by Lance Cedric Tan's avatar Lance Cedric Tan

Created admin panel

parent 76ca3835
No preview for this file type
from django.contrib import admin
# Register your models here.
\ No newline at end of file
from .models import ForumPost, Reply
class ForumPostAdmin(admin.ModelAdmin):
model = ForumPost
search_fields = ('title', 'body', 'author',)
list_display = ('title', 'body', 'author', 'pub_datetime',)
list_filter = ('title', 'author', 'pub_datetime',)
class ReplyAdmin(admin.ModelAdmin):
model = Reply
search_fields = ('body', 'author',)
list_display = ('body', 'author', 'pub_datetime',)
list_filter = ('author', 'pub_datetime')
admin.site.register(ForumPost, ForumPostAdmin)
admin.site.register(Reply, ReplyAdmin)
\ 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