Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mavlee_music
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
Mavrick Jordan Lee
mavlee_music
Commits
08bb0e50
Commit
08bb0e50
authored
Feb 21, 2023
by
Mavrick Jordan Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added Admin Panel in Homepage App
parent
02f1ef5e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
db.sqlite3
mavlee_music/db.sqlite3
+0
-0
admin.py
mavlee_music/homepage/admin.py
+24
-0
No files found.
mavlee_music/db.sqlite3
View file @
08bb0e50
No preview for this file type
mavlee_music/homepage/admin.py
View file @
08bb0e50
from
django.contrib
import
admin
from
django.contrib
import
admin
from
.models
import
Artist
,
Album
,
Song
# Register your models here.
# Register your models here.
class
ArtistAdmin
(
admin_ModelAdmin
):
model
=
Artist
list_display
=
(
'artist name'
,
'birth name'
,
'monthly listeners'
)
search_fields
=
(
'artist name'
,
'birth name'
)
list_filter
=
(
'artist name'
,
'birth name'
)
class
AlbumAdmin
(
admin_ModelAdmin
):
model
=
Album
list_display
=
(
'album name'
,
'description'
,
'release date'
,
'label'
,
'song count'
)
search_fields
=
(
'album name'
,
'description'
,
'label'
)
list_filter
=
(
'album name'
)
class
SongAdmin
(
admin_ModelAdmin
):
model
=
Song
list_display
=
(
'song title'
,
'song length'
,
'lyrics'
,
'music video flag'
)
search_fields
=
(
'song title'
,
'lyrics'
)
list_filter
=
(
'song title'
)
admin
.
site
.
register
(
Artist
)
admin
.
site
.
register
(
Album
)
admin
.
site
.
register
(
Song
)
\ No newline at end of file
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