Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
widget_group3
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
Jonathan Talbot
widget_group3
Commits
9f79d6ea
Commit
9f79d6ea
authored
Mar 23, 2022
by
iceman2434
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added ForumAdmin, updated model functions
parent
c04d0a33
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
1 deletion
+24
-1
admin.py
widget_group3/widget_group3/admin.py
+20
-1
models.py
widget_group3/widget_group3/models.py
+3
-0
settings.py
widget_group3/widget_group3/settings.py
+1
-0
No files found.
widget_group3/widget_group3/admin.py
View file @
9f79d6ea
from
django.contrib
import
admin
from
.models
import
Forum
#from .models import WidgetUser, Announcement, Post, Assignment
\ No newline at end of file
class
ForumAdmin
(
admin
.
ModelAdmin
):
model
=
Forum
search_fields
=
(
'post_title'
,
'post_body'
,
'pub_date'
)
list_display
=
(
'post_title'
,
'post_body'
,
'pub_date'
)
list_filter
=
(
'post_title'
,
'post_body'
,
'pub_date'
)
fieldsets
=
[
(
'Forum Data'
,
{
'fields'
:
[
'post_title'
,
'list_display'
,
'list_filter'
]
}),
]
admin
.
site
.
register
(
Forum
,
ForumAdmin
)
widget_group3/widget_group3/models.py
View file @
9f79d6ea
...
...
@@ -10,3 +10,6 @@ class Forum(models.Model):
def
__str__
(
self
):
return
self
.
post_title
def
get_absolute_url
(
self
):
return
reverse
(
'forum'
,
args
=
[(
self
.
post_title
)])
widget_group3/widget_group3/settings.py
View file @
9f79d6ea
...
...
@@ -40,6 +40,7 @@ INSTALLED_APPS = [
'django.contrib.sessions'
,
'django.contrib.messages'
,
'django.contrib.staticfiles'
,
'widget_group3'
,
]
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