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
40121131
Commit
40121131
authored
Apr 05, 2022
by
Norberto Tadeo
😔
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'Forum' into 'master'
Forum See merge request
!5
parents
37e95182
f0ec44c0
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
5 deletions
+35
-5
models.cpython-39.pyc
widget_group22/forum/__pycache__/models.cpython-39.pyc
+0
-0
views.cpython-39.pyc
widget_group22/forum/__pycache__/views.cpython-39.pyc
+0
-0
0006_alter_post_author_alter_reply_author.py
...m/migrations/0006_alter_post_author_alter_reply_author.py
+25
-0
0006_alter_post_author_alter_reply_author.cpython-39.pyc
.../0006_alter_post_author_alter_reply_author.cpython-39.pyc
+0
-0
views.py
widget_group22/forum/views.py
+10
-5
No files found.
widget_group22/forum/__pycache__/models.cpython-39.pyc
View file @
40121131
No preview for this file type
widget_group22/forum/__pycache__/views.cpython-39.pyc
View file @
40121131
No preview for this file type
widget_group22/forum/migrations/0006_alter_post_author_alter_reply_author.py
0 → 100644
View file @
40121131
# Generated by Django 4.0.3 on 2022-04-05 15:38
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'homepage'
,
'0006_widgetuser_department'
),
(
'forum'
,
'0005_reply_author'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'post'
,
name
=
'author'
,
field
=
models
.
ForeignKey
(
default
=
'Anonymous'
,
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'homepage.widgetuser'
),
),
migrations
.
AlterField
(
model_name
=
'reply'
,
name
=
'author'
,
field
=
models
.
ForeignKey
(
default
=
'Anonymous'
,
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'homepage.widgetuser'
),
),
]
widget_group22/forum/migrations/__pycache__/0006_alter_post_author_alter_reply_author.cpython-39.pyc
0 → 100644
View file @
40121131
File added
widget_group22/forum/views.py
View file @
40121131
...
...
@@ -13,8 +13,11 @@ def displayForumPosts(request):
P_body
=
Post
.
post_body
P_pub_date
=
Post
.
pub_date
PostThread
=
(
"<br><font size='+1'> Post ("
+
P_title
+
") by "
+
str
(
Post
.
author
)
+
" dated "
+
str
(
P_pub_date
)
+
": <br>"
+
P_body
+
"</font>"
)
output
+=
PostThread
+
"<br>"
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
...
...
@@ -23,7 +26,9 @@ def displayForumPosts(request):
if
ReplytoPost
==
P_title
and
R_body
!=
NULL
:
ReplyThread
=
(
"<br> Reply to ("
+
ReplytoPost
+
") by "
+
str
(
Reply
.
author
)
+
" dated "
+
str
(
R_pub_date
)
+
": <br>"
+
R_body
)
output
+=
ReplyThread
+
"<br>"
"<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
)
\ 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