Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
stefan_gomez_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
Stefan Gomez
stefan_gomez_music
Commits
1bf75cc2
Commit
1bf75cc2
authored
Feb 21, 2023
by
Stefan Gomez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated the admin.py of the Homepage with required customizations.
parent
b42e63a3
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
100 additions
and
13 deletions
+100
-13
admin.cpython-311.pyc
...an_gomez_music/Homepage/__pycache__/admin.cpython-311.pyc
+0
-0
models.cpython-311.pyc
...n_gomez_music/Homepage/__pycache__/models.cpython-311.pyc
+0
-0
admin.py
stefan_gomez_music/Homepage/admin.py
+9
-0
0002_album_label_album_song_count_artist_bio_and_more.py
.../0002_album_label_album_song_count_artist_bio_and_more.py
+78
-0
0002_album_label_album_song_count_artist_bio_and_more.cpython-311.pyc
...abel_album_song_count_artist_bio_and_more.cpython-311.pyc
+0
-0
models.py
stefan_gomez_music/Homepage/models.py
+13
-13
db.sqlite3
stefan_gomez_music/db.sqlite3
+0
-0
No files found.
stefan_gomez_music/Homepage/__pycache__/admin.cpython-311.pyc
View file @
1bf75cc2
No preview for this file type
stefan_gomez_music/Homepage/__pycache__/models.cpython-311.pyc
View file @
1bf75cc2
No preview for this file type
stefan_gomez_music/Homepage/admin.py
View file @
1bf75cc2
...
@@ -3,12 +3,21 @@ from .models import Artist, Album, Song
...
@@ -3,12 +3,21 @@ 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
list_display
=
(
'song_title'
,
'song_length'
,
'lyrics'
,
'music_video'
,)
search_fields
=
(
'song_title'
,
'lyrics'
,)
list_filter
=
(
'song_title'
,)
admin
.
site
.
register
(
Artist
,
ArtistAdmin
)
admin
.
site
.
register
(
Artist
,
ArtistAdmin
)
...
...
stefan_gomez_music/Homepage/migrations/0002_album_label_album_song_count_artist_bio_and_more.py
0 → 100644
View file @
1bf75cc2
# Generated by Django 4.1.7 on 2023-02-21 10:22
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
(
max_length
=
100
,
null
=
True
),
),
migrations
.
AddField
(
model_name
=
'album'
,
name
=
'song_count'
,
field
=
models
.
IntegerField
(
null
=
True
),
),
migrations
.
AddField
(
model_name
=
'artist'
,
name
=
'bio'
,
field
=
models
.
TextField
(
max_length
=
700
,
null
=
True
),
),
migrations
.
AddField
(
model_name
=
'artist'
,
name
=
'birth_name'
,
field
=
models
.
CharField
(
max_length
=
100
,
null
=
True
),
),
migrations
.
AddField
(
model_name
=
'song'
,
name
=
'lyrics'
,
field
=
models
.
TextField
(
null
=
True
),
),
migrations
.
AddField
(
model_name
=
'song'
,
name
=
'music_video'
,
field
=
models
.
BooleanField
(
null
=
True
),
),
migrations
.
AlterField
(
model_name
=
'album'
,
name
=
'album_name'
,
field
=
models
.
CharField
(
max_length
=
100
,
null
=
True
),
),
migrations
.
AlterField
(
model_name
=
'album'
,
name
=
'description'
,
field
=
models
.
TextField
(
null
=
True
),
),
migrations
.
AlterField
(
model_name
=
'album'
,
name
=
'release_date'
,
field
=
models
.
CharField
(
max_length
=
100
,
null
=
True
),
),
migrations
.
AlterField
(
model_name
=
'artist'
,
name
=
'artist_name'
,
field
=
models
.
CharField
(
max_length
=
100
,
null
=
True
),
),
migrations
.
AlterField
(
model_name
=
'artist'
,
name
=
'monthly_listeners'
,
field
=
models
.
IntegerField
(
null
=
True
),
),
migrations
.
AlterField
(
model_name
=
'song'
,
name
=
'song_length'
,
field
=
models
.
IntegerField
(
null
=
True
),
),
migrations
.
AlterField
(
model_name
=
'song'
,
name
=
'song_title'
,
field
=
models
.
CharField
(
max_length
=
100
,
null
=
True
),
),
]
stefan_gomez_music/Homepage/migrations/__pycache__/0002_album_label_album_song_count_artist_bio_and_more.cpython-311.pyc
0 → 100644
View file @
1bf75cc2
File added
stefan_gomez_music/Homepage/models.py
View file @
1bf75cc2
from
django.db
import
models
from
django.db
import
models
class
Artist
(
models
.
Model
):
class
Artist
(
models
.
Model
):
artist_name
=
models
.
CharField
(
max_length
=
100
)
artist_name
=
models
.
CharField
(
max_length
=
100
,
null
=
True
)
monthly_listeners
=
models
.
IntegerField
()
monthly_listeners
=
models
.
IntegerField
(
null
=
True
)
birth_name
=
models
.
CharField
(
max_length
=
100
)
birth_name
=
models
.
CharField
(
max_length
=
100
,
null
=
True
)
bio
=
models
.
TextField
(
max_length
=
700
)
bio
=
models
.
TextField
(
max_length
=
700
,
null
=
True
)
class
Album
(
models
.
Model
):
class
Album
(
models
.
Model
):
album_name
=
models
.
CharField
(
max_length
=
100
)
album_name
=
models
.
CharField
(
max_length
=
100
,
null
=
True
)
artist
=
models
.
ForeignKey
(
artist
=
models
.
ForeignKey
(
Artist
,
Artist
,
on_delete
=
models
.
CASCADE
on_delete
=
models
.
CASCADE
)
)
description
=
models
.
TextField
()
description
=
models
.
TextField
(
null
=
True
)
release_date
=
models
.
CharField
(
max_length
=
100
)
release_date
=
models
.
CharField
(
max_length
=
100
,
null
=
True
)
label
=
models
.
CharField
(
max_length
=
100
)
label
=
models
.
CharField
(
max_length
=
100
,
null
=
True
)
song_count
=
models
.
IntegerField
()
song_count
=
models
.
IntegerField
(
null
=
True
)
class
Song
(
models
.
Model
):
class
Song
(
models
.
Model
):
song_title
=
models
.
CharField
(
max_length
=
100
)
song_title
=
models
.
CharField
(
max_length
=
100
,
null
=
True
)
artist
=
models
.
ForeignKey
(
artist
=
models
.
ForeignKey
(
Artist
,
Artist
,
on_delete
=
models
.
CASCADE
on_delete
=
models
.
CASCADE
...
@@ -27,6 +27,6 @@ class Song(models.Model):
...
@@ -27,6 +27,6 @@ class Song(models.Model):
Album
,
Album
,
on_delete
=
models
.
CASCADE
on_delete
=
models
.
CASCADE
)
)
song_length
=
models
.
IntegerField
()
song_length
=
models
.
IntegerField
(
null
=
True
)
music_video
=
models
.
BooleanField
()
music_video
=
models
.
BooleanField
(
null
=
True
)
lyrics
=
models
.
TextField
()
lyrics
=
models
.
TextField
(
null
=
True
)
stefan_gomez_music/db.sqlite3
View file @
1bf75cc2
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