Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nicsdevega_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
Nics De Vega
nicsdevega_music
Commits
887f2856
Commit
887f2856
authored
Feb 20, 2023
by
Nics De Vega
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
created admin panel, added corrections to models
parent
3dacf159
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
51 additions
and
1 deletion
+51
-1
db.sqlite3
nicsdevega_music/db.sqlite3
+0
-0
admin.cpython-39.pyc
nicsdevega_music/homepage/__pycache__/admin.cpython-39.pyc
+0
-0
models.cpython-39.pyc
nicsdevega_music/homepage/__pycache__/models.cpython-39.pyc
+0
-0
admin.py
nicsdevega_music/homepage/admin.py
+32
-1
0008_album_label.py
nicsdevega_music/homepage/migrations/0008_album_label.py
+18
-0
0008_album_label.cpython-39.pyc
...ge/migrations/__pycache__/0008_album_label.cpython-39.pyc
+0
-0
models.py
nicsdevega_music/homepage/models.py
+1
-0
No files found.
nicsdevega_music/db.sqlite3
View file @
887f2856
No preview for this file type
nicsdevega_music/homepage/__pycache__/admin.cpython-39.pyc
View file @
887f2856
No preview for this file type
nicsdevega_music/homepage/__pycache__/models.cpython-39.pyc
View file @
887f2856
No preview for this file type
nicsdevega_music/homepage/admin.py
View file @
887f2856
from
django.contrib
import
admin
from
django.contrib
import
admin
# Register your models here.
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_field
=
(
"album_name"
,
"description"
,
"label"
)
list_filter
=
(
"album_name"
,)
class
SongAdmin
(
admin
.
ModelAdmin
):
moodel
=
Song
list_display
=
(
"song_title"
,
"song_length"
,
"lyrics"
,
"music_video"
)
search_field
=
(
"song_title"
,
"lyrics"
)
list_filter
=
(
"song_title"
,)
admin
.
site
.
register
(
Artist
,
ArtistAdmin
)
admin
.
site
.
register
(
Album
,
AlbumAdmin
)
admin
.
site
.
register
(
Song
,
SongAdmin
)
nicsdevega_music/homepage/migrations/0008_album_label.py
0 → 100644
View file @
887f2856
# Generated by Django 4.1.6 on 2023-02-20 08:07
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'homepage'
,
'0007_alter_album_song_count'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'album'
,
name
=
'label'
,
field
=
models
.
CharField
(
default
=
''
,
max_length
=
100
),
),
]
nicsdevega_music/homepage/migrations/__pycache__/0008_album_label.cpython-39.pyc
0 → 100644
View file @
887f2856
File added
nicsdevega_music/homepage/models.py
View file @
887f2856
...
@@ -11,6 +11,7 @@ class Album(models.Model):
...
@@ -11,6 +11,7 @@ class Album(models.Model):
artist
=
models
.
ForeignKey
(
Artist
,
on_delete
=
models
.
CASCADE
)
artist
=
models
.
ForeignKey
(
Artist
,
on_delete
=
models
.
CASCADE
)
description
=
models
.
TextField
(
max_length
=
700
,
default
=
""
)
description
=
models
.
TextField
(
max_length
=
700
,
default
=
""
)
release_date
=
models
.
DateField
()
release_date
=
models
.
DateField
()
label
=
models
.
CharField
(
max_length
=
100
,
default
=
""
)
song_count
=
models
.
IntegerField
(
default
=
0
)
song_count
=
models
.
IntegerField
(
default
=
0
)
class
Song
(
models
.
Model
):
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