Commit 3bfd39a8 authored by Ian Rafael T. Aragoza's avatar Ian Rafael T. Aragoza

Updated homepage models and README.txt.

parent 0dd04113
...@@ -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
...@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment