Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
joei_yucoco_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
Joei Yucoco
joei_yucoco_music
Commits
bf41c49a
Commit
bf41c49a
authored
Feb 21, 2023
by
Joei Yucoco
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved models to Homepage, configured admin panels and customized it
parent
2d3a8ded
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
36 deletions
+46
-36
.DS_Store
.DS_Store
+0
-0
.DS_Store
joei_yucoco_music/.DS_Store
+0
-0
admin.py
joei_yucoco_music/About/admin.py
+0
-17
models.py
joei_yucoco_music/About/models.py
+24
-19
models.py
joei_yucoco_music/Homepage/models.py
+22
-0
db.sqlite3
joei_yucoco_music/db.sqlite3
+0
-0
No files found.
.DS_Store
View file @
bf41c49a
No preview for this file type
joei_yucoco_music/.DS_Store
View file @
bf41c49a
No preview for this file type
joei_yucoco_music/About/admin.py
View file @
bf41c49a
from
django.contrib
import
admin
from
.models
import
Artist
,
Album
,
Song
class
ArtistAdmin
(
admin
.
ModelAdmin
):
model
=
Artist
class
AlbumAdmin
(
admin
.
ModelAdmin
):
model
=
Album
class
SongAdmin
(
admin
.
ModelAdmin
):
model
=
Song
# registering the model and the admin is what tells
# Django that admin pages must be generated for the models specified
admin
.
site
.
register
(
Artist
,
ArtistAdmin
)
admin
.
site
.
register
(
Album
,
AlbumAdmin
)
admin
.
site
.
register
(
Song
,
SongAdmin
)
# Register your models here.
joei_yucoco_music/About/models.py
View file @
bf41c49a
from
django.db
import
models
class
Artist
(
models
.
Model
):
artist_name
=
models
.
CharField
(
max_length
=
100
)
monthly_listeners
=
models
.
IntegerField
()
birth_name
=
models
.
CharField
(
max_length
=
100
)
bio
=
models
.
CharField
(
max_length
=
700
)
from
.models
import
Artist
,
Album
,
Song
class
Album
(
models
.
Model
):
album_name
=
models
.
CharField
(
max_length
=
100
)
artist
=
models
.
ForeignKey
(
Artist
,
on_delete
=
models
.
CASCADE
)
description
=
models
.
CharField
(
max_length
=
500
)
release_date
=
models
.
DateField
()
label
=
models
.
CharField
(
max_length
=
100
)
song_count
=
models
.
IntegerField
()
class
ArtistAdmin
(
admin
.
ModelAdmin
):
model
=
Artist
search_fields
=
(
'artist_name'
,
'birth_name'
,)
list_display
=
(
'artist_name'
,
'birth_name'
,
'monthly_listeners'
,)
list_filter
=
(
'artsit_name'
,
'birth_name'
,)
class
AlbumAdmin
(
admin
.
ModelAdmin
):
model
=
Album
search_fields
=
(
'album_name'
,
'description'
,
'label'
,)
list_display
=
(
'album_name'
,
'description'
,
'release_date'
,
'label'
,
'song_count'
,)
list_filter
=
(
'album_name'
,)
class
SongAdmin
(
admin
.
ModelAdmin
):
model
=
Song
search_fields
=
(
'song_title'
,
'lyrics'
,)
list_display
=
(
'song_title'
,
'song_length'
,
'lyrics'
,
'music_video'
,)
list_filter
=
(
'song_title'
,)
# registering the model and the admin is what tells
# Django that admin pages must be generated for the models specified
admin
.
site
.
register
(
Artist
,
ArtistAdmin
)
admin
.
site
.
register
(
Album
,
AlbumAdmin
)
admin
.
site
.
register
(
Song
,
SongAdmin
)
class
Song
(
models
.
Model
):
song_title
=
models
.
CharField
(
max_length
=
100
)
artist
=
models
.
ForeignKey
(
Artist
,
on_delete
=
models
.
CASCADE
)
album
=
models
.
ForeignKey
(
Album
,
on_delete
=
models
.
CASCADE
)
song_length
=
models
.
IntegerField
()
music_video
=
models
.
BooleanField
()
lyrics
=
models
.
CharField
(
max_length
=
5000
)
# Create your models here.
joei_yucoco_music/Homepage/models.py
View file @
bf41c49a
from
django.db
import
models
class
Artist
(
models
.
Model
):
artist_name
=
models
.
CharField
(
max_length
=
100
)
monthly_listeners
=
models
.
IntegerField
()
birth_name
=
models
.
TextField
()
bio
=
models
.
CharField
(
max_length
=
700
)
class
Album
(
models
.
Model
):
album_name
=
models
.
CharField
(
max_length
=
100
)
artist
=
models
.
ForeignKey
(
Artist
,
on_delete
=
models
.
CASCADE
)
description
=
models
.
TextField
()
release_date
=
models
.
DateField
()
label
=
models
.
CharField
(
max_length
=
100
)
song_count
=
models
.
IntegerField
()
class
Song
(
models
.
Model
):
song_title
=
models
.
CharField
(
max_length
=
100
)
artist
=
models
.
ForeignKey
(
Artist
,
on_delete
=
models
.
CASCADE
)
album
=
models
.
ForeignKey
(
Album
,
on_delete
=
models
.
CASCADE
)
song_length
=
models
.
IntegerField
()
music_video
=
models
.
BooleanField
()
lyrics
=
models
.
TextField
()
# Create your models here.
joei_yucoco_music/db.sqlite3
View file @
bf41c49a
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