Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
midterm_vincentdjango
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
1
Merge Requests
1
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
Almira Redoble
midterm_vincentdjango
Commits
128cf48c
Commit
128cf48c
authored
Mar 01, 2023
by
Almira Redoble
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented Admin Panel
parent
4ffca08f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
3 deletions
+39
-3
admin.cpython-311.pyc
...vincentdjango/dashboard/__pycache__/admin.cpython-311.pyc
+0
-0
models.cpython-311.pyc
...incentdjango/dashboard/__pycache__/models.cpython-311.pyc
+0
-0
admin.py
widget_vincentdjango/dashboard/admin.py
+39
-1
models.py
widget_vincentdjango/dashboard/models.py
+0
-2
db.sqlite3
widget_vincentdjango/db.sqlite3
+0
-0
No files found.
widget_vincentdjango/dashboard/__pycache__/admin.cpython-311.pyc
View file @
128cf48c
No preview for this file type
widget_vincentdjango/dashboard/__pycache__/models.cpython-311.pyc
View file @
128cf48c
No preview for this file type
widget_vincentdjango/dashboard/admin.py
View file @
128cf48c
from
django.contrib
import
admin
from
django.contrib
import
admin
from
.models
import
Department
,
WidgetUser
# Register your models here.
class
WidgetUserInline
(
admin
.
TabularInline
):
model
=
WidgetUser
class
WidgetUserAdmin
(
admin
.
ModelAdmin
):
model
=
WidgetUser
list_display
=
(
'last_name'
,
'first_name'
,
'department'
)
search_fields
=
(
'last_name'
,
'first_name'
,
'department'
)
list_filter
=
(
'last_name'
,
'department'
)
fieldsets
=
[
(
'Name'
,
{
'fields'
:
((
'last_name'
,
'first_name'
),
'middle_name'
,
'department'
,),
}),
]
class
DepartmentAdmin
(
admin
.
ModelAdmin
):
model
=
Department
search_fields
=
(
'dept_name'
,
'home_unit'
)
list_filter
=
(
'home_unit'
,
)
fieldsets
=
[
(
'Details'
,
{
'fields'
:
((
'dept_name'
,
'home_unit'
),),
}),
]
inlines
=
[
WidgetUserInline
,
]
admin
.
site
.
register
(
Department
,
DepartmentAdmin
)
admin
.
site
.
register
(
WidgetUser
,
WidgetUserAdmin
)
widget_vincentdjango/dashboard/models.py
View file @
128cf48c
...
@@ -25,5 +25,3 @@ class WidgetUser(models.Model):
...
@@ -25,5 +25,3 @@ class WidgetUser(models.Model):
self
.
first_name
,
self
.
first_name
,
self
.
middle_name
self
.
middle_name
)
)
# Create your models here.
widget_vincentdjango/db.sqlite3
View file @
128cf48c
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