Updated admin.py file

parent d9848de4
from django.contrib import admin
# Register your models here.
from .models import Announcement, Reaction
class AnnouncementAdmin(admin.ModelAdmin):
model = Announcement
list_display = ('title', 'author', 'pub_datetime')
search_fields = ('author')
list_filter = ['author', 'pub_datetime']
class ReactionAdmin(admin.ModelAdmin):
model = Reaction
list_display = ('name', 'tally', 'announcement')
search_fields = ('name')
list_filter = ['name']
admin.site.register(Announcement, AnnouncementAdmin)
admin.site.register(Reaction, ReactionAdmin)
\ 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