Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
neilocampo_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
Christianneil Emmanuel Ocampo
neilocampo_music
Commits
605724e6
Commit
605724e6
authored
Feb 20, 2023
by
Christianneil Emmanuel Ocampo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created admin displays, search fields, and filters
parent
fec47881
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
69 additions
and
7 deletions
+69
-7
db.sqlite3
neilocampo_music/db.sqlite3
+0
-0
admin.cpython-39.pyc
neilocampo_music/homepage/__pycache__/admin.cpython-39.pyc
+0
-0
models.cpython-39.pyc
neilocampo_music/homepage/__pycache__/models.cpython-39.pyc
+0
-0
admin.py
neilocampo_music/homepage/admin.py
+20
-1
0002_album_label_album_song_count_artist_bio_and_more.py
.../0002_album_label_album_song_count_artist_bio_and_more.py
+43
-0
0002_album_label_album_song_count_artist_bio_and_more.cpython-39.pyc
...label_album_song_count_artist_bio_and_more.cpython-39.pyc
+0
-0
models.py
neilocampo_music/homepage/models.py
+6
-6
No files found.
neilocampo_music/db.sqlite3
View file @
605724e6
No preview for this file type
neilocampo_music/homepage/__pycache__/admin.cpython-39.pyc
View file @
605724e6
No preview for this file type
neilocampo_music/homepage/__pycache__/models.cpython-39.pyc
View file @
605724e6
No preview for this file type
neilocampo_music/homepage/admin.py
View file @
605724e6
...
@@ -5,8 +5,27 @@ from .models import Artist, Album, Song
...
@@ -5,8 +5,27 @@ from .models import Artist, Album, Song
class
ArtistAdmin
(
admin
.
ModelAdmin
):
class
ArtistAdmin
(
admin
.
ModelAdmin
):
model
=
Artist
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
):
class
AlbumAdmin
(
admin
.
ModelAdmin
):
model
=
Album
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
):
class
SongAdmin
(
admin
.
ModelAdmin
):
model
=
Song
model
=
Song
\ No newline at end of file
list_display
=
(
'song_title'
,
'lyrics'
,)
search_fields
=
(
'song_title'
,
'lyrics'
,)
list_filter
=
(
'song_title'
,)
admin
.
site
.
register
(
Artist
,
ArtistAdmin
)
admin
.
site
.
register
(
Album
,
AlbumAdmin
)
admin
.
site
.
register
(
Song
,
SongAdmin
)
neilocampo_music/homepage/migrations/0002_album_label_album_song_count_artist_bio_and_more.py
0 → 100644
View file @
605724e6
# Generated by Django 4.1.6 on 2023-02-20 12:04
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'homepage'
,
'0001_initial'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'album'
,
name
=
'label'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
100
,
null
=
True
),
),
migrations
.
AddField
(
model_name
=
'album'
,
name
=
'song_count'
,
field
=
models
.
IntegerField
(
blank
=
True
,
null
=
True
),
),
migrations
.
AddField
(
model_name
=
'artist'
,
name
=
'bio'
,
field
=
models
.
TextField
(
blank
=
True
,
max_length
=
700
,
null
=
True
),
),
migrations
.
AddField
(
model_name
=
'artist'
,
name
=
'birth_name'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
100
,
null
=
True
),
),
migrations
.
AddField
(
model_name
=
'song'
,
name
=
'lyrics'
,
field
=
models
.
TextField
(
blank
=
True
,
null
=
True
),
),
migrations
.
AddField
(
model_name
=
'song'
,
name
=
'music_video'
,
field
=
models
.
BooleanField
(
blank
=
True
,
null
=
True
),
),
]
neilocampo_music/homepage/migrations/__pycache__/0002_album_label_album_song_count_artist_bio_and_more.cpython-39.pyc
0 → 100644
View file @
605724e6
File added
neilocampo_music/homepage/models.py
View file @
605724e6
...
@@ -5,8 +5,8 @@ from django.urls import reverse
...
@@ -5,8 +5,8 @@ from django.urls import reverse
class
Artist
(
models
.
Model
):
class
Artist
(
models
.
Model
):
artist_name
=
models
.
CharField
(
max_length
=
100
)
artist_name
=
models
.
CharField
(
max_length
=
100
)
monthly_listeners
=
models
.
IntegerField
()
monthly_listeners
=
models
.
IntegerField
()
birth_name
=
models
.
CharField
(
max_length
=
100
)
birth_name
=
models
.
CharField
(
max_length
=
100
,
blank
=
True
,
null
=
True
)
bio
=
models
.
TextField
(
max_length
=
700
)
bio
=
models
.
TextField
(
max_length
=
700
,
blank
=
True
,
null
=
True
)
def
__str__
(
self
):
def
__str__
(
self
):
return
'{}'
.
format
(
self
.
artist_name
)
return
'{}'
.
format
(
self
.
artist_name
)
...
@@ -20,8 +20,8 @@ class Album(models.Model):
...
@@ -20,8 +20,8 @@ class Album(models.Model):
artist
=
models
.
ForeignKey
(
Artist
,
on_delete
=
models
.
CASCADE
)
artist
=
models
.
ForeignKey
(
Artist
,
on_delete
=
models
.
CASCADE
)
description
=
models
.
CharField
(
max_length
=
300
)
description
=
models
.
CharField
(
max_length
=
300
)
release_date
=
models
.
DateField
()
release_date
=
models
.
DateField
()
label
=
models
.
CharField
(
max_length
=
100
)
label
=
models
.
CharField
(
max_length
=
100
,
blank
=
True
,
null
=
True
)
song_count
=
models
.
IntegerField
()
song_count
=
models
.
IntegerField
(
blank
=
True
,
null
=
True
)
def
__str__
(
self
):
def
__str__
(
self
):
return
'{}'
.
format
(
self
.
album_name
)
return
'{}'
.
format
(
self
.
album_name
)
...
@@ -35,8 +35,8 @@ class Song(models.Model):
...
@@ -35,8 +35,8 @@ class Song(models.Model):
artist
=
models
.
ForeignKey
(
Artist
,
on_delete
=
models
.
CASCADE
)
artist
=
models
.
ForeignKey
(
Artist
,
on_delete
=
models
.
CASCADE
)
album
=
models
.
ForeignKey
(
Album
,
on_delete
=
models
.
CASCADE
)
album
=
models
.
ForeignKey
(
Album
,
on_delete
=
models
.
CASCADE
)
song_length
=
models
.
DurationField
()
song_length
=
models
.
DurationField
()
music_video
=
models
.
BooleanField
()
music_video
=
models
.
BooleanField
(
blank
=
True
,
null
=
True
)
lyrics
=
models
.
TextField
()
lyrics
=
models
.
TextField
(
blank
=
True
,
null
=
True
)
def
__str__
(
self
):
def
__str__
(
self
):
return
'{}'
.
format
(
self
.
song_title
)
return
'{}'
.
format
(
self
.
song_title
)
...
...
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