Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_tee jays angelos
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
Ramon Angelo Enriquez
widget_tee jays angelos
Commits
0d12a9a3
Commit
0d12a9a3
authored
May 25, 2022
by
Ryan Angelo G. Lim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed a FBV into a CBV
parent
1e5668a8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
8 deletions
+11
-8
db.sqlite3
widget_tee_jays_angelos/db.sqlite3
+0
-0
urls.py
widget_tee_jays_angelos/forum/urls.py
+3
-2
views.py
widget_tee_jays_angelos/forum/views.py
+8
-6
test-image_g2rzSqR.jpg
...ays_angelos/static/images/forumimg/test-image_g2rzSqR.jpg
+0
-0
No files found.
widget_tee_jays_angelos/db.sqlite3
View file @
0d12a9a3
No preview for this file type
widget_tee_jays_angelos/forum/urls.py
View file @
0d12a9a3
from
django.urls
import
path
from
django.conf.urls.static
import
static
from
.
import
views
from
.views
import
ForumView
app_name
=
"forum"
urlpatterns
=
[
path
(
''
,
views
.
index
,
name
=
"forum"
),
path
(
''
,
ForumView
.
as_view
()
,
name
=
"forum"
),
path
(
'posts/add/'
,
views
.
add
,
name
=
"add"
),
path
(
'posts/<int:post_id>/details/'
,
views
.
details
,
name
=
"details"
),
]
widget_tee_jays_angelos/forum/views.py
View file @
0d12a9a3
...
...
@@ -4,14 +4,16 @@ from forum.models import Post, Reply, WidgetUser
from
django.shortcuts
import
render
,
redirect
from
django.template
import
loader
from
.forms
import
PostForm
from
django.views
import
View
# Create your views here.
def
index
(
request
):
post_list
=
Post
.
objects
.
order_by
(
"pub_date"
)
context
=
{
"post_list"
:
post_list
,
}
return
render
(
request
,
"forum/index.html"
,
context
)
class
ForumView
(
View
):
def
get
(
self
,
request
):
post_list
=
Post
.
objects
.
order_by
(
"pub_date"
)
context
=
{
"post_list"
:
post_list
,
}
return
render
(
request
,
"forum/index.html"
,
context
)
def
getReply
(
pk
):
postReply
=
[]
...
...
widget_tee_jays_angelos/static/images/forumimg/test-image_g2rzSqR.jpg
0 → 100644
View file @
0d12a9a3
3.71 KB
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