Commit a7e99a18 authored by Lance Cedric Tan's avatar Lance Cedric Tan

Created admin panel

parent d7068207
No preview for this file type
from django.contrib import admin from django.contrib import admin
# Register your models here. 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(ForumPost, ForumPostAdmin)
admin.site.register(Reply, ReplyAdmin) 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