Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_group22
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
John Tamano
widget_group22
Commits
3ce4bf3c
Commit
3ce4bf3c
authored
May 13, 2022
by
N1o9r4b7e9r6to
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed lines of comments
parent
f72d18cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
35 deletions
+0
-35
views.py
widget_group22/forum/views.py
+0
-35
No files found.
widget_group22/forum/views.py
View file @
3ce4bf3c
...
...
@@ -6,41 +6,6 @@ from django.template import Template, Context
from
django.template.loader
import
get_template
from
forum.models
import
Post
,
Reply
"""
def displayForumPosts(request):
ForumPosts = models.Post.objects.all()
ForumReplies = models.Reply.objects.all()
output = ""
for Post in ForumPosts:
P_title = Post.post_title
P_body = Post.post_body
P_pub_date = Post.pub_date
PostThread = (
"<br><font size='+1.5'> '<b>" + P_title + "</b>' by <i>" + str(Post.author.first_name) + " " +
str(Post.author.last_name) + "</i> dated " + str(P_pub_date) + ": <br>" + P_body + "</font>"
)
output += PostThread + ""
for Reply in ForumReplies:
ReplytoPost = Reply.post.post_title
R_body = Reply.reply_body
R_pub_date = Reply.pub_date
if ReplytoPost == P_title and R_body != None:
ReplyThread = (
"<br> Reply by <i>" + str(Reply.author.first_name) + " " + str(Reply.author.last_name) +
"</i> dated " + str(R_pub_date) + ": <br>" + R_body
)
output += ReplyThread + ""
output += "<br>"
return HttpResponse('<h1>FORUM POSTS: </h1>' + output )
def index(request):
return HttpResponse("This is Widget's Forum!")
"""
def
forumposts
(
request
):
all_posts
=
models
.
Post
.
objects
.
order_by
(
"-pub_date"
)
#all_replies = models.Reply.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