Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_group17
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
Vaughn Nephi Fajardo
widget_group17
Commits
139d83e7
Commit
139d83e7
authored
Apr 04, 2022
by
Neal Berones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: edited view for the announcements app to display announcements
parent
bb7bf5b9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
8 additions
and
7 deletions
+8
-7
models.cpython-310.pyc
...group_17/announcements/__pycache__/models.cpython-310.pyc
+0
-0
urls.cpython-310.pyc
...t_group_17/announcements/__pycache__/urls.cpython-310.pyc
+0
-0
views.cpython-310.pyc
..._group_17/announcements/__pycache__/views.cpython-310.pyc
+0
-0
urls.py
widget_group_17/announcements/urls.py
+3
-2
views.py
widget_group_17/announcements/views.py
+5
-5
No files found.
widget_group_17/announcements/__pycache__/models.cpython-310.pyc
View file @
139d83e7
No preview for this file type
widget_group_17/announcements/__pycache__/urls.cpython-310.pyc
View file @
139d83e7
No preview for this file type
widget_group_17/announcements/__pycache__/views.cpython-310.pyc
View file @
139d83e7
No preview for this file type
widget_group_17/announcements/urls.py
View file @
139d83e7
...
@@ -2,5 +2,6 @@ from django.urls import path
...
@@ -2,5 +2,6 @@ from django.urls import path
from
.
import
views
from
.
import
views
urlpatterns
=
[
urlpatterns
=
[
path
(
''
,
views
.
index
,
name
=
'index'
)
path
(
''
,
views
.
index
,
name
=
'index'
),
]
path
(
'welcome'
,
views
.
welcome
,
name
=
'welcome'
)
\ No newline at end of file
]
widget_group_17/announcements/views.py
View file @
139d83e7
...
@@ -3,7 +3,7 @@ from django.shortcuts import render
...
@@ -3,7 +3,7 @@ from django.shortcuts import render
from
.models
import
WidgetUser
,
Announcement
,
Reaction
from
.models
import
WidgetUser
,
Announcement
,
Reaction
# Create your views here.
# Create your views here.
def
index
(
request
):
def
welcome
(
request
):
return
HttpResponse
(
"This is the Announcement Board!"
)
return
HttpResponse
(
"This is the Announcement Board!"
)
def
index
(
request
):
def
index
(
request
):
...
@@ -16,13 +16,13 @@ def index(request):
...
@@ -16,13 +16,13 @@ def index(request):
love_tally
=
0
love_tally
=
0
angry_tally
=
0
angry_tally
=
0
for
r
in
reactions
:
for
r
in
reactions
:
if
r
.
reaction_name
==
Like
and
r
.
announcement
==
a
:
if
r
.
reaction_name
==
"Like"
and
r
.
announcement
==
a
:
like_tally
+=
r
.
tally
like_tally
+=
r
.
tally
elif
r
.
reaction_name
==
Love
and
r
.
announcement
==
a
:
elif
r
.
reaction_name
==
"Love"
and
r
.
announcement
==
a
:
love_tally
+=
r
.
tally
love_tally
+=
r
.
tally
elif
r
.
reaction_name
==
Angry
and
r
.
announcement
==
a
:
elif
r
.
reaction_name
==
"Angry"
and
r
.
announcement
==
a
:
angry_tally
+=
r
.
tally
angry_tally
+=
r
.
tally
announcement_view
+=
"<br/> {} by {} {} dated {}: <br/> {} <br/>
{} <br/> {} <br/> {}
"
.
\
announcement_view
+=
"<br/> {} by {} {} dated {}: <br/> {} <br/>
Like: {} <br/> Love: {} <br/> Angry: {} <br/>
"
.
\
format
(
a
.
announcement_title
,
format
(
a
.
announcement_title
,
a
.
author
.
first_name
,
a
.
author
.
first_name
,
a
.
author
.
last_name
,
a
.
author
.
last_name
,
...
...
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