Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_group17
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
Vaughn Nephi Fajardo
widget_group17
Commits
bec84554
Commit
bec84554
authored
Apr 04, 2022
by
Neal Berones
Browse files
Options
Browse Files
Download
Plain Diff
resolved file conflicts
parents
139d83e7
272241dd
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
5 deletions
+31
-5
urls.cpython-39.pyc
widget_group_17/forum/__pycache__/urls.cpython-39.pyc
+0
-0
views.cpython-39.pyc
widget_group_17/forum/__pycache__/views.cpython-39.pyc
+0
-0
urls.py
widget_group_17/forum/urls.py
+2
-2
views.py
widget_group_17/forum/views.py
+29
-3
No files found.
widget_group_17/forum/__pycache__/urls.cpython-39.pyc
View file @
bec84554
No preview for this file type
widget_group_17/forum/__pycache__/views.cpython-39.pyc
View file @
bec84554
No preview for this file type
widget_group_17/forum/urls.py
View file @
bec84554
from
django.urls
import
path
from
django.urls
import
path
from
.
import
views
from
.
import
views
urlpatterns
=
[
urlpatterns
=
[
path
(
''
,
views
.
index
,
name
=
"index"
)
path
(
''
,
views
.
index
,
name
=
"index"
),
path
(
'welcome'
,
views
.
welcome
,
name
=
'welcome'
)
]
]
\ No newline at end of file
widget_group_17/forum/views.py
View file @
bec84554
from
django.shortcuts
import
render
from
django.http
import
HttpResponse
from
django.http
import
HttpResponse
from
.models
import
Post
,
Reply
# Create your views here.
# Create your views here.
def
welcome
(
request
):
return
HttpResponse
(
"Welcome to Widget's forum!"
)
def
index
(
request
):
def
index
(
request
):
return
HttpResponse
(
forum_view
=
"FORUM POSTS: "
"<h2>FORUM POSTS:</h2> [Title] by [Author] dated [Date]: <br> "
posts
=
Post
.
objects
.
all
()
)
replies
=
Reply
.
objects
.
all
()
for
post
in
posts
:
forum_view
+=
"<br> {} by {} {} dated {}: <br> {}"
.
\
format
(
post
.
post_title
,
post
.
author
.
first_name
,
post
.
author
.
last_name
,
post
.
pub_date
,
post
.
post_body
)
for
reply
in
replies
:
forum_view
+=
'<br> Reply by {} {} dated {}: <br> {}'
.
\
format
(
reply
.
author
.
first_name
,
reply
.
author
.
last_name
,
reply
.
pub_date
,
reply
.
reply_body
)
return
HttpResponse
(
forum_view
)
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