Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
diannedelpilar_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
Fritzie Dianne Del Pilar
diannedelpilar_music
Commits
5a7efc78
Commit
5a7efc78
authored
Feb 20, 2023
by
Fritzie Dianne Del Pilar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update models.py
parent
43f41f8d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
6 deletions
+14
-6
models.py
diannedelpilar_music/homepage/models.py
+14
-6
No files found.
diannedelpilar_music/homepage/models.py
View file @
5a7efc78
...
@@ -4,17 +4,22 @@ from django.db import models
...
@@ -4,17 +4,22 @@ 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
)
monthly_listeners
=
models
.
PositiveIntegerField
()
monthly_listeners
=
models
.
PositiveIntegerField
()
birth_name
=
models
.
CharField
(
max_length
=
100
)
birth_name
=
models
.
CharField
(
max_length
=
100
,
null
=
True
)
bio
=
models
.
CharField
(
max_length
=
700
)
bio
=
models
.
CharField
(
max_length
=
700
,
null
=
True
)
def
__str__
(
self
):
return
self
.
artist_name
class
Album
(
models
.
Model
):
class
Album
(
models
.
Model
):
album_name
=
models
.
CharField
(
max_length
=
100
)
album_name
=
models
.
CharField
(
max_length
=
100
)
artist
=
models
.
ForeignKey
(
Artist
,
on_delete
=
models
.
CASCADE
)
artist
=
models
.
ForeignKey
(
Artist
,
on_delete
=
models
.
CASCADE
)
description
=
models
.
CharField
(
max_length
=
200
)
description
=
models
.
CharField
(
max_length
=
200
,
null
=
True
)
release_date
=
models
.
CharField
(
max_length
=
100
)
release_date
=
models
.
CharField
(
max_length
=
100
)
label
=
models
.
CharField
(
max_length
=
100
,
null
=
True
)
label
=
models
.
CharField
(
max_length
=
100
,
null
=
True
)
song_count
=
models
.
PositiveIntegerField
()
song_count
=
models
.
PositiveIntegerField
(
null
=
True
)
def
__str__
(
self
):
return
self
.
album_name
class
Song
(
models
.
Model
):
class
Song
(
models
.
Model
):
...
@@ -22,5 +27,8 @@ class Song(models.Model):
...
@@ -22,5 +27,8 @@ class Song(models.Model):
artist
=
models
.
ForeignKey
(
Artist
,
on_delete
=
models
.
CASCADE
)
artist
=
models
.
ForeignKey
(
Artist
,
on_delete
=
models
.
CASCADE
)
album
=
models
.
ForeignKey
(
Album
,
on_delete
=
models
.
CASCADE
)
album
=
models
.
ForeignKey
(
Album
,
on_delete
=
models
.
CASCADE
)
song_length
=
models
.
PositiveIntegerField
()
song_length
=
models
.
PositiveIntegerField
()
music_video
=
models
.
BooleanField
()
music_video
=
models
.
BooleanField
(
null
=
True
)
lyrics
=
models
.
CharField
(
max_length
=
1000
)
lyrics
=
models
.
CharField
(
max_length
=
1000
,
null
=
True
)
\ No newline at end of file
def
__str__
(
self
):
return
self
.
song_title
\ No newline at end of file
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