Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
ianaragoza_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
Ian Rafael T. Aragoza
ianaragoza_music
Commits
3bfd39a8
Commit
3bfd39a8
authored
Feb 20, 2023
by
Ian Rafael T. Aragoza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated homepage models and README.txt.
parent
0dd04113
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
README.txt
README.txt
+2
-2
models.py
ianaragoza_music/homepage/models.py
+6
-0
No files found.
README.txt
View file @
3bfd39a8
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
## BS CS-DGDD
## BS CS-DGDD
## CSCI 40 - F
## CSCI 40 - F
## Lab 01 Song Library
## Lab 01 Song Library
## Submitted February
13
, 2023
## Submitted February
20
, 2023
## This lab requirement was completed truthfully and completely by myself.
## This lab requirement was completed truthfully and completely by myself.
sgd
sgd
Ian Rafael T. Aragoza, February 13, 2023
Ian Rafael T. Aragoza, February 20, 2023
\ No newline at end of file
\ No newline at end of file
ianaragoza_music/homepage/models.py
View file @
3bfd39a8
...
@@ -7,7 +7,9 @@ from django.urls import reverse
...
@@ -7,7 +7,9 @@ from django.urls import reverse
class
Artist
(
models
.
Model
):
class
Artist
(
models
.
Model
):
artist_name
=
models
.
CharField
(
max_length
=
100
,
unique
=
True
)
artist_name
=
models
.
CharField
(
max_length
=
100
,
unique
=
True
)
birth_name
=
models
.
CharField
(
max_length
=
100
)
monthly_listeners
=
models
.
IntegerField
()
monthly_listeners
=
models
.
IntegerField
()
bio
=
models
.
CharField
(
max_length
=
700
)
def
__str__
(
self
):
def
__str__
(
self
):
return
'{}'
.
format
(
self
.
artist_name
,
self
.
monthly_listeners
)
return
'{}'
.
format
(
self
.
artist_name
,
self
.
monthly_listeners
)
...
@@ -20,6 +22,8 @@ class Album(models.Model):
...
@@ -20,6 +22,8 @@ class Album(models.Model):
artist
=
models
.
ForeignKey
(
Artist
,
on_delete
=
models
.
CASCADE
,
related_name
=
'albums'
)
artist
=
models
.
ForeignKey
(
Artist
,
on_delete
=
models
.
CASCADE
,
related_name
=
'albums'
)
description
=
models
.
CharField
(
max_length
=
255
)
description
=
models
.
CharField
(
max_length
=
255
)
release_date
=
models
.
DateField
()
release_date
=
models
.
DateField
()
label
=
models
.
CharField
(
max_length
=
100
)
song_count
=
models
.
IntegerField
()
def
__str__
(
self
):
def
__str__
(
self
):
return
'{} by {}'
.
format
(
self
.
album_name
,
self
.
artist
)
return
'{} by {}'
.
format
(
self
.
album_name
,
self
.
artist
)
...
@@ -32,6 +36,8 @@ class Song(models.Model):
...
@@ -32,6 +36,8 @@ class Song(models.Model):
artist
=
models
.
ForeignKey
(
Artist
,
on_delete
=
models
.
CASCADE
,
related_name
=
'songs'
)
artist
=
models
.
ForeignKey
(
Artist
,
on_delete
=
models
.
CASCADE
,
related_name
=
'songs'
)
album
=
models
.
ForeignKey
(
Album
,
on_delete
=
models
.
CASCADE
,
related_name
=
'songs'
)
album
=
models
.
ForeignKey
(
Album
,
on_delete
=
models
.
CASCADE
,
related_name
=
'songs'
)
song_length
=
models
.
DurationField
()
song_length
=
models
.
DurationField
()
music_video
=
models
.
BooleanField
()
lyrics
=
models
.
CharField
()
def
__str__
(
self
):
def
__str__
(
self
):
return
'{} - {} ({})'
.
format
(
self
.
artist
,
self
.
song_title
,
self
.
song_length
)
return
'{} - {} ({})'
.
format
(
self
.
artist
,
self
.
song_title
,
self
.
song_length
)
...
...
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