Commit 438c1106 authored by Ross Batacan's avatar Ross Batacan

Removed inline feature in admin.py and unnecessary comments

parent e09a862a
...@@ -4,18 +4,12 @@ from .models import Announcement, Reaction ...@@ -4,18 +4,12 @@ from .models import Announcement, Reaction
# Register your models here. # Register your models here.
# class ReactionInLine(admin.TabularInline):
# model = Reaction
class AnnouncementAdmin(admin.ModelAdmin): class AnnouncementAdmin(admin.ModelAdmin):
model = Announcement model = Announcement
list_display = ('announcement_title', 'announcement_body', 'announcement_pub_datetime') list_display = ('announcement_title', 'announcement_body', 'announcement_pub_datetime')
search_fields = ('announcement_title',) search_fields = ('announcement_title',)
list_filter = ('announcement_title',) list_filter = ('announcement_title',)
# inlines = [ReactionInLine]
class ReactionAdmin(admin.ModelAdmin): class ReactionAdmin(admin.ModelAdmin):
model = Reaction model = Reaction
......
...@@ -3,7 +3,6 @@ from django.db import models ...@@ -3,7 +3,6 @@ from django.db import models
# Create your models here. # Create your models here.
# please insert foreign key from dashboard application on announcement_author # please insert foreign key from dashboard application on announcement_author
class Announcement(models.Model): class Announcement(models.Model):
announcement_title = models.CharField(max_length=50, unique=True, null=True, ) announcement_title = models.CharField(max_length=50, unique=True, null=True, )
......
# from django.http import HttpResponse
# from .models import Announcement, Reaction
#
#
# # Create your views here.
#
#
# def announcements(request):
# announcement = Announcement.objects.all()
# react = Reaction.objects.all()
#
# head = "Widget's Announcement Board <br><br>Announcements:"
# response = ''
#
# for every in announcement:
# like_on_post = 0
# love_on_post = 0
# angry_on_post = 0
#
# reaction = Reaction.objects.filter(reaction_announcement=every)
#
# datetime = every.announcement_pub_datetime.strftime("%a, %b %d, %Y %I:%M %p")
# response += every.announcement_title + " by " + "--insert foreign name-- " + "published <br>" +\
# datetime + "<br>"
#
# for r in reaction:
# response += r.reaction_name + ": " + str(r.reaction_tally) + "<br>"
# response += "<br>"
#
# final = head + "<br><br>" + response
#
# return HttpResponse(final)
from django.http import HttpResponse from django.http import HttpResponse
from .models import Announcement, Reaction from .models import Announcement, Reaction
# Create your views here.
def announcements(request): def announcements(request):
announcement = Announcement.objects.all() announcement = Announcement.objects.all()
......
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