Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_jupert
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
Joseph Izon
widget_jupert
Commits
aa820f35
Commit
aa820f35
authored
Apr 07, 2022
by
Ronan Phillippe B. Artuz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created Reply model and Added author field in Post and Reply model.
parent
8f03eaf4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
models.py
widget_jupert/forum/models.py
+11
-2
No files found.
widget_jupert/forum/models.py
View file @
aa820f35
from
django.db
import
models
from
django.db
import
models
from
homepage.models
import
WidgetUser
# Create your models here.
# Create your models here.
class
Post
(
models
.
Model
):
class
Post
(
models
.
Model
):
post_title
=
models
.
CharField
(
max_length
=
50
)
post_title
=
models
.
CharField
(
max_length
=
50
)
post_body
=
models
.
CharField
(
max_length
=
500
)
post_body
=
models
.
CharField
(
max_length
=
500
)
pub_date
=
models
.
DateTimeField
(
"date published"
)
pub_date
=
models
.
DateTimeField
(
"date published"
)
author
=
models
.
ForeignKey
(
WidgetUser
,
on_delete
=
models
.
CASCADE
,
default
=
1
)
def
__str__
(
self
):
def
__str__
(
self
):
return
self
.
post_title
return
self
.
post_title
class
Reply
(
models
.
Model
):
post
=
models
.
ForeignKey
(
Post
,
on_delete
=
models
.
CASCADE
,
default
=
1
)
reply_body
=
models
.
CharField
(
max_length
=
250
)
pub_date
=
models
.
DateTimeField
(
"date published"
)
author
=
models
.
ForeignKey
(
WidgetUser
,
on_delete
=
models
.
CASCADE
,
default
=
1
)
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