Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_group3
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
Jonathan Talbot
widget_group3
Commits
fe94ab32
Commit
fe94ab32
authored
Apr 07, 2022
by
iceman2434
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added backup code
if the __str__ model for posts and replies won't work, replace the forum function
parent
ac190421
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
1 deletion
+15
-1
views.py
widget_group3/widget_group3/views.py
+15
-1
No files found.
widget_group3/widget_group3/views.py
View file @
fe94ab32
...
...
@@ -17,3 +17,17 @@ def forum(request):
reply
=
Reply
.
objects
.
all
()
output
=
"FORUM POSTS:<br>"
+
"<br>"
.
join
([
str
(
x
)
for
x
in
post
])
+
"<br>"
.
join
([
str
(
z
)
for
z
in
reply
])
return
HttpResponse
(
output
,
content_type
=
"text/plain"
)
# def forum(request):
# post = Post.objects.all()
# reply = Reply.objects.all()
# posts = ""
# replies = ""
# for x in post:
# posts += '<br>{} by {} dated {}:<br> {}'.format(x.post_title, x.author.full_name(), x.pub_date, x.post_body)
# for y in reply:
# replies += '<br>Reply by {} dated {}:<br> {}'.format(y.author.full_name(), y.pub_date, y.reply_body)
# output = "FORUM POSTS:" + posts + replies
# return HttpResponse(output, content_type="text/plain")
\ 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