Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_k3git
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
Stefan Gomez
midterm_k3git
Commits
eb27b0c9
Commit
eb27b0c9
authored
Mar 05, 2023
by
Migs Atienza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Configured Views
parent
717a5f34
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
1 deletion
+12
-1
db.sqlite3
widget_k3git/db.sqlite3
+0
-0
models.cpython-39.pyc
widget_k3git/forum/__pycache__/models.cpython-39.pyc
+0
-0
views.cpython-39.pyc
widget_k3git/forum/__pycache__/views.cpython-39.pyc
+0
-0
views.py
widget_k3git/forum/views.py
+12
-1
No files found.
widget_k3git/db.sqlite3
View file @
eb27b0c9
No preview for this file type
widget_k3git/forum/__pycache__/models.cpython-39.pyc
View file @
eb27b0c9
No preview for this file type
widget_k3git/forum/__pycache__/views.cpython-39.pyc
View file @
eb27b0c9
No preview for this file type
widget_k3git/forum/views.py
View file @
eb27b0c9
from
django.shortcuts
import
render
from
django.shortcuts
import
render
from
django.http
import
HttpResponse
from
django.http
import
HttpResponse
from
.models
import
ForumPost
,
Reply
def
index
(
request
):
def
index
(
request
):
page_content
=
"""<H1>Widget’s Forum</H1>"""
page_content
=
"""<H1>Widget’s Forum</H1>"""
for
forum
in
ForumPost
.
objects
.
all
():
page_content
+=
"""<br>
{} by {} posted {}:<br>
{}<br>
"""
.
format
(
forum
.
title
,
forum
.
author
,
forum
.
pub_datetime
,
forum
.
body
)
for
reply
in
Reply
.
objects
.
all
():
if
reply
.
forum_post
==
forum
:
page_content
+=
"""Reply by {} posted {}:
{}
"""
.
format
(
reply
.
author
,
reply
.
pub_datetime
,
reply
.
body
)
return
HttpResponse
(
page_content
)
return
HttpResponse
(
page_content
)
# Create your views here.
# Create your views here.
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