Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_princessgabi
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
Ysabella Panghulan
midterm_princessgabi
Commits
b233dbd9
Commit
b233dbd9
authored
Mar 04, 2023
by
Trisha Angel Millena
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
edited views.py: edited for loops
parent
dde9c6b5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
4 deletions
+3
-4
views.cpython-39.pyc
widget_princessgabi/forum/__pycache__/views.cpython-39.pyc
+0
-0
views.py
widget_princessgabi/forum/views.py
+3
-4
No files found.
widget_princessgabi/forum/__pycache__/views.cpython-39.pyc
View file @
b233dbd9
No preview for this file type
widget_princessgabi/forum/views.py
View file @
b233dbd9
...
@@ -7,12 +7,11 @@ from .models import ForumPost, Reply
...
@@ -7,12 +7,11 @@ from .models import ForumPost, Reply
def
index
(
request
):
def
index
(
request
):
posts
=
ForumPost
.
objects
.
all
()
posts
=
ForumPost
.
objects
.
all
()
replies
=
Reply
.
objects
.
all
()
replies
=
Reply
.
objects
.
all
()
welcom
ing
=
"Widget's Forum<br><br>Forum Posts:<br>"
welcom
eMessage
=
"Widget's Forum<br><br>Forum Posts:<br>"
for
post
in
posts
:
for
post
in
posts
:
for
reply
in
replies
:
for
reply
in
replies
:
if
reply
.
post
.
title
==
post
.
title
:
if
reply
.
post
.
title
==
post
.
title
:
welcoming
=
welcoming
+
post
.
title
+
" by "
+
post
.
author
.
first_name
+
" "
+
post
.
author
.
last_name
+
" posted "
+
post
.
pub_datetime
.
strftime
(
'
%
I:
%
M
%
p'
)
+
":<br>"
+
post
.
body
+
"<br>"
+
"Reply by "
+
reply
.
author
.
first_name
+
" "
+
reply
.
author
.
last_name
+
" posted "
+
reply
.
pub_datetime
.
strftime
(
'
%
I:
%
M
%
p'
)
+
":<br>"
+
reply
.
body
+
"<br>"
welcomeMessage
=
welcomeMessage
+
post
.
title
+
" by "
+
post
.
author
.
first_name
+
" "
+
post
.
author
.
last_name
+
" posted "
+
post
.
pub_datetime
.
strftime
(
'
%
I:
%
M
%
p'
)
+
":<br>"
+
post
.
body
+
"<br>"
+
"Reply by "
+
reply
.
author
.
first_name
+
" "
+
reply
.
author
.
last_name
+
" posted "
+
reply
.
pub_datetime
.
strftime
(
'
%
I:
%
M
%
p'
)
+
":<br>"
+
reply
.
body
+
"<br><br>"
welcoming
=
welcoming
+
post
.
title
+
" by "
+
post
.
author
.
first_name
+
" "
+
post
.
author
.
last_name
+
" posted "
+
post
.
pub_datetime
.
strftime
(
'
%
I:
%
M
%
p'
)
+
":<br>"
+
post
.
body
+
"<br>"
return
HttpResponse
(
welcom
ing
)
return
HttpResponse
(
welcom
eMessage
)
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