Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_group 25
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
Andre Matthew Dumandan
widget_group 25
Commits
6b7d6249
Commit
6b7d6249
authored
May 18, 2022
by
Stephanie Tullao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Altered variable name from pk to post_id
parent
7d3d895a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
urls.py
widget_group_25/forum/urls.py
+1
-1
views.py
widget_group_25/forum/views.py
+2
-2
forum_list.html
..._group_25/widget_group_25/templates/forum/forum_list.html
+1
-1
No files found.
widget_group_25/forum/urls.py
View file @
6b7d6249
...
...
@@ -4,7 +4,7 @@ from .views import post_list_view, post_detail_view
urlpatterns
=
[
path
(
''
,
post_list_view
,
name
=
'post-list'
),
path
(
'<int:p
k
>/details'
,
post_detail_view
,
name
=
'post-details'
),
path
(
'<int:p
ost_id
>/details'
,
post_detail_view
,
name
=
'post-details'
),
]
app_name
=
'forum'
\ No newline at end of file
widget_group_25/forum/views.py
View file @
6b7d6249
...
...
@@ -11,8 +11,8 @@ def post_list_view(request):
return
render
(
request
,
'forum/forum_list.html'
,
context
)
def
post_detail_view
(
request
,
p
k
):
post
=
Post
.
objects
.
get
(
pk
=
pk
)
def
post_detail_view
(
request
,
p
ost_id
):
post
=
Post
.
objects
.
get
(
id
=
post_id
)
reply_list
=
Reply
.
objects
.
filter
(
original_post
=
post
)
.
order_by
(
'-pub_date'
)
.
all
()
context
=
{
'post'
:
post
,
'reply_list'
:
reply_list
...
...
widget_group_25/widget_group_25/templates/forum/forum_list.html
View file @
6b7d6249
...
...
@@ -11,7 +11,7 @@
<h1>
Forum posts:
</h1>
{% for post in post_list %}
<li>
<a
href=
"{% url 'forum:post-details' p
k
=post.pk %}"
>
<a
href=
"{% url 'forum:post-details' p
ost_id
=post.pk %}"
>
{{ post.post_title }} by {{ post.author.first_name }} {{ post.author.last_name }} dated {{ post.pub_date|date:"d/m/Y" }}
</a>
</li>
...
...
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