Commit 57a86bb8 authored by Cherish Magpayo's avatar Cherish Magpayo

Added ReactionAdmin and ReactionAdmin customizations

parent b6509e20
...@@ -2,12 +2,22 @@ from django.contrib import admin ...@@ -2,12 +2,22 @@ from django.contrib import admin
# Register your models here. # Register your models here.
from .models import Announcement from .models import Announcement
from .models import Reaction
class AnnouncementAdmin(admin.ModelAdmin): class AnnouncementAdmin(admin.ModelAdmin):
model = Announcement model = Announcement
search_fields = ('announcement_title',) search_fields = ('announcement_title',)
list_display = ('announcement_title', 'pub_date',) list_display = ('announcement_title', 'pub_date', 'author')
list_filter = ('announcement_title', 'pub_date',) list_filter = ('announcement_title', 'pub_date',)
class ReactionAdmin(admin.ModelAdmin):
model = Reaction
search_fields = ('announcement',)
list_display = ('announcement', 'reaction_name', 'tally')
list_filter = ('announcement',)
admin.site.register(Announcement, AnnouncementAdmin) 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