Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_princessgabi
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
Ysabella Panghulan
midterm_princessgabi
Commits
630a64c6
Commit
630a64c6
authored
May 12, 2023
by
Trisha Angel Millena
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Edited models.py and views.py
parent
66bb255a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
2 additions
and
2 deletions
+2
-2
.DS_Store
.DS_Store
+0
-0
.DS_Store
widget_princessgabi/.DS_Store
+0
-0
models.py
widget_princessgabi/forum/models.py
+1
-1
views.py
widget_princessgabi/forum/views.py
+1
-1
No files found.
.DS_Store
0 → 100644
View file @
630a64c6
File added
widget_princessgabi/.DS_Store
0 → 100644
View file @
630a64c6
File added
widget_princessgabi/forum/models.py
View file @
630a64c6
...
@@ -8,7 +8,7 @@ class ForumPost(models.Model):
...
@@ -8,7 +8,7 @@ class ForumPost(models.Model):
title
=
models
.
CharField
(
max_length
=
300
)
title
=
models
.
CharField
(
max_length
=
300
)
body
=
models
.
TextField
(
max_length
=
500
)
body
=
models
.
TextField
(
max_length
=
500
)
author
=
models
.
ForeignKey
(
WidgetUser
,
on_delete
=
models
.
CASCADE
)
author
=
models
.
ForeignKey
(
WidgetUser
,
on_delete
=
models
.
CASCADE
)
pub_datetime
=
models
.
DateTimeField
()
pub_datetime
=
models
.
DateTimeField
(
auto_now_add
=
True
)
def
__str__
(
self
):
def
__str__
(
self
):
return
self
.
title
return
self
.
title
...
...
widget_princessgabi/forum/views.py
View file @
630a64c6
...
@@ -5,7 +5,7 @@ from django.views.generic.detail import DetailView
...
@@ -5,7 +5,7 @@ from django.views.generic.detail import DetailView
from
django.views.generic.edit
import
CreateView
,
UpdateView
from
django.views.generic.edit
import
CreateView
,
UpdateView
def
forum
(
request
):
def
forum
(
request
):
posts
=
ForumPost
.
objects
.
all
()
posts
=
ForumPost
.
objects
.
all
()
.
order_by
(
'-pub_datetime'
)
replies
=
Reply
.
objects
.
all
()
replies
=
Reply
.
objects
.
all
()
context
=
{
context
=
{
'forumposts'
:
posts
,
'forumposts'
:
posts
,
...
...
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