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
4981c003
Commit
4981c003
authored
Mar 24, 2022
by
Ronan Phillippe B. Artuz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created a model named Post for Forum
parent
6466fb1e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
1 deletion
+42
-1
admin.py
widget_jupert/forum/admin.py
+11
-1
0001_initial.py
widget_jupert/forum/migrations/0001_initial.py
+23
-0
models.py
widget_jupert/forum/models.py
+7
-0
settings.py
widget_jupert/widget_jupert/settings.py
+1
-0
No files found.
widget_jupert/forum/admin.py
View file @
4981c003
from
django.contrib
import
admin
# Register your models here.
from
.models
import
Post
class
PostAdmin
(
admin
.
ModelAdmin
):
model
=
Post
search_fields
=
(
'post_title'
,)
list_display
=
(
'post_title'
,
'pub_date'
,)
list_filter
=
(
'post_title'
,
'pub_date'
,)
admin
.
site
.
register
(
Post
,
PostAdmin
)
\ No newline at end of file
widget_jupert/forum/migrations/0001_initial.py
0 → 100644
View file @
4981c003
# Generated by Django 3.2.12 on 2022-03-24 13:04
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
initial
=
True
dependencies
=
[
]
operations
=
[
migrations
.
CreateModel
(
name
=
'Post'
,
fields
=
[
(
'id'
,
models
.
BigAutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'post_title'
,
models
.
CharField
(
max_length
=
50
)),
(
'post_body'
,
models
.
CharField
(
max_length
=
500
)),
(
'pub_date'
,
models
.
DateTimeField
(
verbose_name
=
'date published'
)),
],
),
]
widget_jupert/forum/models.py
View file @
4981c003
from
django.db
import
models
# Create your models here.
class
Post
(
models
.
Model
):
post_title
=
models
.
CharField
(
max_length
=
50
)
post_body
=
models
.
CharField
(
max_length
=
500
)
pub_date
=
models
.
DateTimeField
(
"date published"
)
def
__str__
(
self
):
return
self
.
post_title
\ No newline at end of file
widget_jupert/widget_jupert/settings.py
View file @
4981c003
...
...
@@ -38,6 +38,7 @@ ALLOWED_HOSTS = []
INSTALLED_APPS
=
[
'announcements.apps.AnnouncementsConfig'
,
'assignments.apps.AssignmentsConfig'
,
'forum.apps.ForumConfig'
,
'homepage.apps.HomepageConfig'
,
'django.contrib.admin'
,
'django.contrib.auth'
,
...
...
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