Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bresciaamandy_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
Brescia Amandy
bresciaamandy_music
Commits
f31c5086
Commit
f31c5086
authored
Feb 21, 2023
by
Brescia Amandy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added list view customizations to homepage/admin.py
parent
d34218f8
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
107 additions
and
1 deletion
+107
-1
admin.cpython-310.pyc
homepage/__pycache__/admin.cpython-310.pyc
+0
-0
models.cpython-310.pyc
homepage/__pycache__/models.cpython-310.pyc
+0
-0
admin.py
homepage/admin.py
+9
-0
0002_auto_20230221_1942.py
homepage/migrations/0002_auto_20230221_1942.py
+79
-0
0003_auto_20230221_1944.py
homepage/migrations/0003_auto_20230221_1944.py
+18
-0
0002_auto_20230221_1942.cpython-310.pyc
...tions/__pycache__/0002_auto_20230221_1942.cpython-310.pyc
+0
-0
0003_auto_20230221_1944.cpython-310.pyc
...tions/__pycache__/0003_auto_20230221_1944.cpython-310.pyc
+0
-0
models.py
homepage/models.py
+1
-1
No files found.
homepage/__pycache__/admin.cpython-310.pyc
View file @
f31c5086
No preview for this file type
homepage/__pycache__/models.cpython-310.pyc
View file @
f31c5086
No preview for this file type
homepage/admin.py
View file @
f31c5086
...
...
@@ -4,12 +4,21 @@ from .models import Artist, Album, Song
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'
)
search_fields
=
(
'song_title'
,
'lyrics'
)
list_filter
=
(
'song_title'
)
admin
.
site
.
register
(
Artist
,
ArtistAdmin
)
admin
.
site
.
register
(
Album
,
AlbumAdmin
)
...
...
homepage/migrations/0002_auto_20230221_1942.py
0 → 100644
View file @
f31c5086
# Generated by Django 3.0 on 2023-02-21 11:42
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
=
255
),
),
migrations
.
AddField
(
model_name
=
'album'
,
name
=
'song_count'
,
field
=
models
.
IntegerField
(
blank
=
True
,
default
=
1
),
preserve_default
=
False
,
),
migrations
.
AddField
(
model_name
=
'artist'
,
name
=
'bio'
,
field
=
models
.
TextField
(
blank
=
True
,
max_length
=
700
),
),
migrations
.
AddField
(
model_name
=
'artist'
,
name
=
'birth_name'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
255
),
),
migrations
.
AddField
(
model_name
=
'song'
,
name
=
'lyrics'
,
field
=
models
.
TextField
(
blank
=
True
),
),
migrations
.
AddField
(
model_name
=
'song'
,
name
=
'music_video'
,
field
=
models
.
BooleanField
(
default
=
False
),
),
migrations
.
AlterField
(
model_name
=
'album'
,
name
=
'album_name'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
255
),
),
migrations
.
AlterField
(
model_name
=
'album'
,
name
=
'description'
,
field
=
models
.
TextField
(
blank
=
True
,
max_length
=
700
),
),
migrations
.
AlterField
(
model_name
=
'album'
,
name
=
'release_date'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
255
),
),
migrations
.
AlterField
(
model_name
=
'artist'
,
name
=
'artist_name'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
255
),
),
migrations
.
AlterField
(
model_name
=
'artist'
,
name
=
'monthly_listeners'
,
field
=
models
.
IntegerField
(
blank
=
True
),
),
migrations
.
AlterField
(
model_name
=
'song'
,
name
=
'song_length'
,
field
=
models
.
IntegerField
(
blank
=
True
),
),
migrations
.
AlterField
(
model_name
=
'song'
,
name
=
'song_title'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
255
),
),
]
homepage/migrations/0003_auto_20230221_1944.py
0 → 100644
View file @
f31c5086
# Generated by Django 3.0 on 2023-02-21 11:44
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'homepage'
,
'0002_auto_20230221_1942'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'album'
,
name
=
'song_count'
,
field
=
models
.
PositiveSmallIntegerField
(
default
=
1
),
),
]
homepage/migrations/__pycache__/0002_auto_20230221_1942.cpython-310.pyc
0 → 100644
View file @
f31c5086
File added
homepage/migrations/__pycache__/0003_auto_20230221_1944.cpython-310.pyc
0 → 100644
View file @
f31c5086
File added
homepage/models.py
View file @
f31c5086
...
...
@@ -14,7 +14,7 @@ class Album(models.Model):
description
=
models
.
TextField
(
blank
=
True
,
max_length
=
700
)
release_date
=
models
.
CharField
(
blank
=
True
,
max_length
=
255
)
label
=
models
.
CharField
(
blank
=
True
,
max_length
=
255
)
song_count
=
models
.
IntegerField
(
blank
=
True
)
song_count
=
models
.
PositiveSmallIntegerField
(
default
=
1
)
class
Song
(
models
.
Model
):
...
...
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