Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
rachpurisima_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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rachel
rachpurisima_music
Commits
239c08c6
Commit
239c08c6
authored
Feb 20, 2023
by
rachbit
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed bug: added default values to model attributes
parent
8f9fb9aa
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
110 additions
and
17 deletions
+110
-17
admin.cpython-39.pyc
rachpurisima_music/homepage/__pycache__/admin.cpython-39.pyc
+0
-0
models.cpython-39.pyc
...purisima_music/homepage/__pycache__/models.cpython-39.pyc
+0
-0
admin.py
rachpurisima_music/homepage/admin.py
+2
-2
0002_auto_20230220_0853.py
...sima_music/homepage/migrations/0002_auto_20230220_0853.py
+93
-0
models.py
rachpurisima_music/homepage/models.py
+15
-15
No files found.
rachpurisima_music/homepage/__pycache__/admin.cpython-39.pyc
View file @
239c08c6
No preview for this file type
rachpurisima_music/homepage/__pycache__/models.cpython-39.pyc
View file @
239c08c6
No preview for this file type
rachpurisima_music/homepage/admin.py
View file @
239c08c6
...
...
@@ -18,7 +18,7 @@ class AlbumAdmin(admin.ModelAdmin):
list_display
=
(
'album_name'
,
'description'
,
'release_date'
,
'label'
,
'song_count'
)
search_fields
=
(
'album_name'
,
'description'
,
'label'
)
list_filter
=
(
'album_name'
)
list_filter
=
(
'album_name'
,
)
class
SongAdmin
(
admin
.
ModelAdmin
):
...
...
@@ -26,7 +26,7 @@ class SongAdmin(admin.ModelAdmin):
list_display
=
(
'song_title'
,
'song_length'
,
'lyrics'
,
'music_video'
)
search_fields
=
(
'song_title'
,
'lyrics'
)
list_filter
=
(
'song_title'
)
list_filter
=
(
'song_title'
,
)
# registering the model and the admin is what tells
...
...
rachpurisima_music/homepage/migrations/0002_auto_20230220_0853.py
0 → 100644
View file @
239c08c6
# Generated by Django 3.2 on 2023-02-20 08:53
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'homepage'
,
'0001_initial'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'album'
,
name
=
'label'
,
field
=
models
.
TextField
(
default
=
''
),
),
migrations
.
AddField
(
model_name
=
'album'
,
name
=
'song_count'
,
field
=
models
.
IntegerField
(
default
=
''
),
),
migrations
.
AddField
(
model_name
=
'artist'
,
name
=
'bio'
,
field
=
models
.
CharField
(
default
=
''
,
max_length
=
700
),
),
migrations
.
AddField
(
model_name
=
'artist'
,
name
=
'birth_name'
,
field
=
models
.
TextField
(
default
=
''
),
),
migrations
.
AddField
(
model_name
=
'song'
,
name
=
'lyrics'
,
field
=
models
.
TextField
(
default
=
''
),
),
migrations
.
AddField
(
model_name
=
'song'
,
name
=
'music_video'
,
field
=
models
.
BooleanField
(
default
=
False
),
),
migrations
.
AlterField
(
model_name
=
'album'
,
name
=
'album_name'
,
field
=
models
.
TextField
(
default
=
''
),
),
migrations
.
AlterField
(
model_name
=
'album'
,
name
=
'artist'
,
field
=
models
.
TextField
(
default
=
''
),
),
migrations
.
AlterField
(
model_name
=
'album'
,
name
=
'description'
,
field
=
models
.
TextField
(
default
=
''
),
),
migrations
.
AlterField
(
model_name
=
'album'
,
name
=
'release_date'
,
field
=
models
.
DateField
(
default
=
''
),
),
migrations
.
AlterField
(
model_name
=
'artist'
,
name
=
'artist_name'
,
field
=
models
.
TextField
(
default
=
''
),
),
migrations
.
AlterField
(
model_name
=
'artist'
,
name
=
'monthly_listeners'
,
field
=
models
.
IntegerField
(
default
=
''
),
),
migrations
.
AlterField
(
model_name
=
'song'
,
name
=
'album'
,
field
=
models
.
TextField
(
default
=
''
),
),
migrations
.
AlterField
(
model_name
=
'song'
,
name
=
'artist'
,
field
=
models
.
TextField
(
default
=
''
),
),
migrations
.
AlterField
(
model_name
=
'song'
,
name
=
'song_length'
,
field
=
models
.
IntegerField
(
default
=
''
),
),
migrations
.
AlterField
(
model_name
=
'song'
,
name
=
'song_title'
,
field
=
models
.
TextField
(
default
=
''
),
),
]
rachpurisima_music/homepage/models.py
View file @
239c08c6
...
...
@@ -4,25 +4,25 @@ from django.db import models
class
Artist
(
models
.
Model
):
artist_name
=
models
.
TextField
()
monthly_listeners
=
models
.
IntegerField
()
birth_name
=
models
.
TextField
()
bio
=
models
.
CharField
(
max_length
=
700
)
artist_name
=
models
.
TextField
(
default
=
""
)
monthly_listeners
=
models
.
IntegerField
(
default
=
""
)
birth_name
=
models
.
TextField
(
default
=
""
)
bio
=
models
.
CharField
(
max_length
=
700
,
default
=
""
)
class
Album
(
models
.
Model
):
album_name
=
models
.
TextField
()
artist
=
models
.
TextField
()
description
=
models
.
TextField
()
release_date
=
models
.
DateField
()
label
=
models
.
TextField
()
song_count
=
models
.
IntegerField
()
album_name
=
models
.
TextField
(
default
=
""
)
artist
=
models
.
TextField
(
default
=
""
)
description
=
models
.
TextField
(
default
=
""
)
release_date
=
models
.
DateField
(
default
=
""
)
label
=
models
.
TextField
(
default
=
""
)
song_count
=
models
.
IntegerField
(
default
=
""
)
class
Song
(
models
.
Model
):
song_title
=
models
.
TextField
()
artist
=
models
.
TextField
()
album
=
models
.
TextField
()
song_length
=
models
.
IntegerField
()
song_title
=
models
.
TextField
(
default
=
""
)
artist
=
models
.
TextField
(
default
=
""
)
album
=
models
.
TextField
(
default
=
""
)
song_length
=
models
.
IntegerField
(
default
=
""
)
music_video
=
models
.
BooleanField
(
default
=
False
)
lyrics
=
models
.
TextField
()
lyrics
=
models
.
TextField
(
default
=
""
)
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