Commit fc417a65 authored by Agu Syquia's avatar Agu Syquia

Updated admin.py

Added admin classes and registered the models
parent 834ac9c8
from django.contrib import admin from django.contrib import admin
from .models import Announcement, Reaction
# Register your models here. class AnnouncementAdmin(admin.ModelAdmin):
model = Announcement
search_fields = ('title', 'author',)
list_display = ('title', 'body', 'author', 'pub_datetime',)
list_filter = ('title', 'author', 'pub_datetime',)
class ReactionAdmin(admin.ModelAdmin):
model = Reaction
search_fields = ('name', 'announcement',)
list_display = ('name', 'tally', 'announcement',)
list_filter = ('name', 'tally',)
admin.site.register(Announcement, AnnouncementAdmin)
admin.site.register(Reaction, ReactionAdmin)
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