Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gab_salas_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
Jose Gabriel L. Salas
gab_salas_music
Commits
64d7d5b5
Commit
64d7d5b5
authored
Feb 21, 2023
by
Jose Gabriel L. Salas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed unneccessary code and added __str__ def
parent
20299b4e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
models.py
gab_salas_music/homepage/models.py
+14
-4
No files found.
gab_salas_music/homepage/models.py
View file @
64d7d5b5
...
...
@@ -5,7 +5,10 @@ class Artist(models.Model):
artist_name
=
models
.
CharField
(
max_length
=
50
)
monthly_listeners
=
models
.
IntegerField
()
birth_name
=
models
.
CharField
(
max_length
=
50
,
blank
=
True
)
bio
=
models
.
CharField
(
max_length
=
700
,
blank
=
True
)
bio
=
models
.
CharField
(
max_length
=
7000
,
blank
=
True
)
def
__str__
(
self
):
return
'{}: {}'
.
format
(
self
.
artist_name
,
self
.
birth_name
)
class
Album
(
models
.
Model
):
...
...
@@ -17,12 +20,19 @@ class Album(models.Model):
label
=
models
.
CharField
(
max_length
=
50
,
blank
=
True
)
song_count
=
models
.
IntegerField
(
default
=
'0'
)
def
__str__
(
self
):
return
'{}: {}'
.
format
(
self
.
album_name
,
self
.
artist
.
artist_name
)
class
Song
(
models
.
Model
):
song_title
=
models
.
CharField
(
max_length
=
100
)
artist
=
models
.
ForeignKey
(
Artist
,
on_delete
=
models
.
CASCADE
,
related_name
=
'song'
)
album
=
models
.
ForeignKey
(
Album
,
on_delete
=
models
.
CASCADE
)
song_length
=
models
.
Integer
Field
()
song_length
=
models
.
Float
Field
()
music_video
=
models
.
BooleanField
(
default
=
None
)
lyrics
=
models
.
CharField
(
max_length
=
6500
,
blank
=
True
)
lyrics
=
models
.
CharField
(
max_length
=
10000
,
blank
=
True
)
def
__str__
(
self
):
return
'{}: {}'
.
format
(
self
.
song_title
,
self
.
artist
.
artist_name
)
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