Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_mgabolanimav
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mavrick Jordan Lee
midterm_mgabolanimav
Commits
438c1106
Commit
438c1106
authored
Mar 05, 2023
by
Ross Batacan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed inline feature in admin.py and unnecessary comments
parent
e09a862a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
40 deletions
+3
-40
admin.py
widget_mgabolanimav/announcements/admin.py
+0
-6
models.py
widget_mgabolanimav/announcements/models.py
+0
-1
views.py
widget_mgabolanimav/announcements/views.py
+3
-33
No files found.
widget_mgabolanimav/announcements/admin.py
View file @
438c1106
...
...
@@ -4,18 +4,12 @@ from .models import Announcement, Reaction
# Register your models here.
# class ReactionInLine(admin.TabularInline):
# model = Reaction
class
AnnouncementAdmin
(
admin
.
ModelAdmin
):
model
=
Announcement
list_display
=
(
'announcement_title'
,
'announcement_body'
,
'announcement_pub_datetime'
)
search_fields
=
(
'announcement_title'
,)
list_filter
=
(
'announcement_title'
,)
# inlines = [ReactionInLine]
class
ReactionAdmin
(
admin
.
ModelAdmin
):
model
=
Reaction
...
...
widget_mgabolanimav/announcements/models.py
View file @
438c1106
...
...
@@ -3,7 +3,6 @@ from django.db import models
# Create your models here.
# please insert foreign key from dashboard application on announcement_author
class
Announcement
(
models
.
Model
):
announcement_title
=
models
.
CharField
(
max_length
=
50
,
unique
=
True
,
null
=
True
,
)
...
...
widget_mgabolanimav/announcements/views.py
View file @
438c1106
# 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
.models
import
Announcement
,
Reaction
# Create your views here.
def
announcements
(
request
):
announcement
=
Announcement
.
objects
.
all
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment