Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_nicsbabes
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
Nics De Vega
midterm_nicsbabes
Commits
f6370b5b
Commit
f6370b5b
authored
Mar 06, 2023
by
Tanya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implemented models of app forum
parent
d7c73665
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
1 deletion
+55
-1
0001_initial.py
widget_nicsbabes/forum/migrations/0001_initial.py
+36
-0
models.py
widget_nicsbabes/forum/models.py
+18
-1
settings.py
widget_nicsbabes/widget_nicsbabes/settings.py
+1
-0
No files found.
widget_nicsbabes/forum/migrations/0001_initial.py
0 → 100644
View file @
f6370b5b
# Generated by Django 4.1.7 on 2023-03-06 03:53
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
initial
=
True
dependencies
=
[
(
'dashboard'
,
'0001_initial'
),
]
operations
=
[
migrations
.
CreateModel
(
name
=
'ForumPost'
,
fields
=
[
(
'id'
,
models
.
BigAutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'title'
,
models
.
CharField
(
default
=
''
,
max_length
=
255
)),
(
'body'
,
models
.
TextField
(
default
=
''
)),
(
'pub_datetime'
,
models
.
DateTimeField
()),
(
'author'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'dashboard.widgetuser'
)),
],
),
migrations
.
CreateModel
(
name
=
'Reply'
,
fields
=
[
(
'id'
,
models
.
BigAutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'body'
,
models
.
TextField
(
default
=
''
)),
(
'pub_datetime'
,
models
.
DateTimeField
()),
(
'author'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'dashboard.widgetuser'
)),
(
'forum_post'
,
models
.
ForeignKey
(
default
=
''
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'forum.forumpost'
)),
],
),
]
widget_nicsbabes/forum/models.py
View file @
f6370b5b
from
django.db
import
models
from
django.db
import
models
from
dashboard.models
import
WidgetUser
# Create your models here.
class
ForumPost
(
models
.
Model
):
title
=
models
.
CharField
(
max_length
=
255
,
default
=
""
)
body
=
models
.
TextField
(
default
=
""
)
author
=
models
.
ForeignKey
(
WidgetUser
,
on_delete
=
models
.
CASCADE
)
pub_datetime
=
models
.
DateTimeField
()
def
__str__
(
self
):
return
'{}'
.
format
(
self
.
title
)
class
Reply
(
models
.
Model
):
body
=
models
.
TextField
(
default
=
""
)
author
=
models
.
ForeignKey
(
WidgetUser
,
on_delete
=
models
.
CASCADE
)
pub_datetime
=
models
.
DateTimeField
()
forum_post
=
models
.
ForeignKey
(
ForumPost
,
on_delete
=
models
.
CASCADE
,
default
=
""
)
def
__str__
(
self
):
return
'{}'
.
format
(
self
.
body
)
\ No newline at end of file
widget_nicsbabes/widget_nicsbabes/settings.py
View file @
f6370b5b
...
@@ -43,6 +43,7 @@ INSTALLED_APPS = [
...
@@ -43,6 +43,7 @@ INSTALLED_APPS = [
'django.contrib.staticfiles'
,
'django.contrib.staticfiles'
,
'announcement_board'
,
'announcement_board'
,
'dashboard'
,
'dashboard'
,
'forum'
,
]
]
MIDDLEWARE
=
[
MIDDLEWARE
=
[
...
...
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