Final Commit before merge

parent 3ac0262e
...@@ -7,6 +7,10 @@ class Artist(models.Model): ...@@ -7,6 +7,10 @@ class Artist(models.Model):
birth_name = models.CharField(max_length=50) birth_name = models.CharField(max_length=50)
bio = models.TextField() bio = models.TextField()
def __str__(self):
return self.artist_name
class Album(models.Model): class Album(models.Model):
album_name = models.TextField() album_name = models.TextField()
artist = models.ForeignKey(Artist, on_delete=models.CASCADE) artist = models.ForeignKey(Artist, on_delete=models.CASCADE)
...@@ -15,6 +19,9 @@ class Album(models.Model): ...@@ -15,6 +19,9 @@ class Album(models.Model):
label = models.TextField() label = models.TextField()
song_count = models.IntegerField(default=0) song_count = models.IntegerField(default=0)
def __str__(self):
return self.album_name
class Song(models.Model): class Song(models.Model):
song_title = models.CharField(max_length=50) song_title = models.CharField(max_length=50)
artist = models.ForeignKey(Artist, on_delete=models.CASCADE) artist = models.ForeignKey(Artist, on_delete=models.CASCADE)
...@@ -22,3 +29,6 @@ class Song(models.Model): ...@@ -22,3 +29,6 @@ class Song(models.Model):
song_length = models.IntegerField(default=0) song_length = models.IntegerField(default=0)
music_video = models.BooleanField(default=False) music_video = models.BooleanField(default=False)
lyrics = models.TextField() lyrics = models.TextField()
def __str__(self):
return self.song_title
\ No newline at end of file
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