Commit 754ddf32 authored by Tanya's avatar Tanya

created admin panel and populated models of app forum

parent f6370b5b
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
list_display = ("title","body","author","pub_datetime")
search_fields = ("title","author")
list_filter = ("title","author")
class ReplyAdmin(admin.ModelAdmin):
model = Reply
list_display = ("body","author","pub_datetime","forum_post")
search_fields = ("author",)
list_filter = ("author",)
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