Added PostAdmin and ReplyAdmin customizations

parent aa820f35
from django.contrib import admin from django.contrib import admin
from .models import Post from .models import Post
from .models import Reply
class PostAdmin(admin.ModelAdmin): class PostAdmin(admin.ModelAdmin):
model = Post model = Post
search_fields = ('post_title',) search_fields = ('post_title',)
list_display = ('post_title', 'pub_date',) list_display = ('post_title', 'pub_date','author')
list_filter = ('post_title', 'pub_date',) list_filter = ('post_title', 'pub_date',)
class ReplyAdmin(admin.ModelAdmin):
model = Reply
search_fields = ('post_title',)
list_display = ('post','pub_date','author')
list_filter = ('post','pub_date','author')
admin.site.register(Post, PostAdmin) admin.site.register(Post, PostAdmin)
admin.site.register(Reply, ReplyAdmin)
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