Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_gitgud
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
Neal Luigi D. Rodriguez
midterm_gitgud
Commits
23908c11
Commit
23908c11
authored
Mar 05, 2023
by
Eury See
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented the views and URLs portion of the Forum application.
parent
53af0f91
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
views.py
widget_gitgud/Forum/views.py
+14
-1
No files found.
widget_gitgud/Forum/views.py
View file @
23908c11
from
django.shortcuts
import
render
from
django.http
import
HttpResponse
from
.models
import
ForumPost
from
.models
import
Reply
def
index
(
request
):
return
HttpResponse
(
'Hello World! This came from the index view'
)
\ No newline at end of file
return_string
=
"<br>"
for
reply
in
Reply
.
objects
.
all
():
return_string
+=
'{} by {} posted {}, {}: <br> {} <br> Reply by {} posted {}, {}: <br> {}'
.
format
(
reply
.
reply_to
.
title
,
reply
.
reply_to
.
author
,
reply
.
reply_to
.
pub_datetime
.
strftime
(
"
%
m/
%
d/
%
Y"
),
reply
.
reply_to
.
pub_datetime
.
strftime
(
"
%
I:
%
M
%
p"
),
reply
.
reply_to
.
body
,
reply
.
author
,
reply
.
pub_datetime
.
strftime
(
"
%
m/
%
d/
%
Y"
),
reply
.
pub_datetime
.
strftime
(
"
%
I:
%
M
%
p"
),
reply
.
body
)
return_string
+=
"<br><br>"
html_string
=
"<html><head> Widget's Forum <br><br> Forum Posts: </head><body> {} </body><html>"
.
format
(
return_string
)
return
HttpResponse
(
html_string
)
\ No newline at end of file
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