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
c749ea36
Commit
c749ea36
authored
Apr 08, 2022
by
Isaiah Flores
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update widget_group3/widget_group3/admin.py
parent
77b7d1ee
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
4 deletions
+18
-4
admin.py
widget_group3/widget_group3/admin.py
+18
-4
No files found.
widget_group3/widget_group3/admin.py
View file @
c749ea36
...
@@ -4,8 +4,8 @@ from .models import WidgetUser, Post, Reply, Announcement, Assignment, Departmen
...
@@ -4,8 +4,8 @@ from .models import WidgetUser, Post, Reply, Announcement, Assignment, Departmen
# Classes
# Classes
class
Department
Inline
(
admin
.
TabularInline
):
class
WidgetUser
Inline
(
admin
.
TabularInline
):
model
=
Department
model
=
WidgetUser
class
WidgetUserAdmin
(
admin
.
ModelAdmin
):
class
WidgetUserAdmin
(
admin
.
ModelAdmin
):
model
=
WidgetUser
model
=
WidgetUser
...
@@ -23,11 +23,24 @@ class WidgetUserAdmin(admin.ModelAdmin):
...
@@ -23,11 +23,24 @@ class WidgetUserAdmin(admin.ModelAdmin):
}),
}),
]
]
inlines
=
[
DepartmentInline
,]
class
DepartmentAdmin
(
admin
.
ModelAdmin
):
class
DepartmentAdmin
(
admin
.
ModelAdmin
):
model
=
Department
model
=
Department
search_fields
=
(
'dept_name'
,
'home_unit'
)
list_display
=
(
'dept_name'
,
'home_unit'
)
list_filter
=
(
'dept_name'
,
'home_unit'
)
fieldsets
=
[
(
'Department Data'
,
{
'fields'
:
[
'dept_name'
,
'home_unit'
,
]
}),
]
inlines
=
[
WidgetUserInline
,]
class
AnnouncementAdmin
(
admin
.
ModelAdmin
):
class
AnnouncementAdmin
(
admin
.
ModelAdmin
):
model
=
Announcement
model
=
Announcement
...
@@ -115,3 +128,4 @@ admin.site.register(Post, PostAdmin)
...
@@ -115,3 +128,4 @@ admin.site.register(Post, PostAdmin)
admin
.
site
.
register
(
Reply
,
ReplyAdmin
)
admin
.
site
.
register
(
Reply
,
ReplyAdmin
)
admin
.
site
.
register
(
Announcement
,
AnnouncementAdmin
)
admin
.
site
.
register
(
Announcement
,
AnnouncementAdmin
)
admin
.
site
.
register
(
Assignment
,
AssignmentAdmin
)
admin
.
site
.
register
(
Assignment
,
AssignmentAdmin
)
admin
.
site
.
register
(
Department
,
DepartmentAdmin
)
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