Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_gitgud
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
Neal Luigi D. Rodriguez
midterm_gitgud
Commits
53af0f91
Commit
53af0f91
authored
Mar 05, 2023
by
Eury See
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented and populated the Admin pages for the Forum application.
parent
02e2337a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
1 deletion
+47
-1
admin.py
widget_gitgud/Forum/admin.py
+12
-1
0001_initial.py
widget_gitgud/Forum/migrations/0001_initial.py
+35
-0
db.sqlite3
widget_gitgud/db.sqlite3
+0
-0
No files found.
widget_gitgud/Forum/admin.py
View file @
53af0f91
from
django.contrib
import
admin
from
.models
import
ForumPost
from
.models
import
Reply
# Register your models here.
class
ForumPostAdmin
(
admin
.
ModelAdmin
):
model
=
ForumPost
list_display
=
(
"title"
,
"body"
,
"author"
,
"pub_datetime"
,)
class
ReplyAdmin
(
admin
.
ModelAdmin
):
model
=
Reply
list_display
=
(
"body"
,
"author"
,
"pub_datetime"
,)
admin
.
site
.
register
(
ForumPost
,
ForumPostAdmin
)
admin
.
site
.
register
(
Reply
,
ReplyAdmin
)
\ No newline at end of file
widget_gitgud/Forum/migrations/0001_initial.py
0 → 100644
View file @
53af0f91
# Generated by Django 4.1.7 on 2023-03-05 18:34
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
initial
=
True
dependencies
=
[
]
operations
=
[
migrations
.
CreateModel
(
name
=
'ForumPost'
,
fields
=
[
(
'id'
,
models
.
BigAutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'title'
,
models
.
CharField
(
max_length
=
100
)),
(
'body'
,
models
.
TextField
()),
(
'author'
,
models
.
CharField
(
max_length
=
50
)),
(
'pub_datetime'
,
models
.
DateTimeField
()),
],
),
migrations
.
CreateModel
(
name
=
'Reply'
,
fields
=
[
(
'id'
,
models
.
BigAutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'body'
,
models
.
TextField
()),
(
'author'
,
models
.
CharField
(
max_length
=
50
)),
(
'pub_datetime'
,
models
.
DateTimeField
()),
(
'reply_to'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'Forum.forumpost'
)),
],
),
]
widget_gitgud/db.sqlite3
View file @
53af0f91
No preview for this file type
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