Commit 8d7d4737 authored by Brescia Amandy's avatar Brescia Amandy

Set labels for each model in in homepage/models.py

parent 7bea1470
......@@ -8,6 +8,9 @@ class Artist(models.Model):
birth_name = models.CharField(blank=True, max_length=255)
bio = models.TextField(blank=True, max_length=700)
def __str__(self):
return self.artist_name
class Album(models.Model):
album_name = models.CharField(blank=True, max_length=255)
artist = models.ForeignKey(Artist, on_delete=models.CASCADE)
......@@ -16,6 +19,8 @@ class Album(models.Model):
label = models.CharField(blank=True, max_length=255)
song_count = models.PositiveSmallIntegerField(default=1)
def __str__(self):
return self.album_name
class Song(models.Model):
song_title = models.CharField(blank=True, max_length=255)
......@@ -24,3 +29,6 @@ class Song(models.Model):
song_length = models.IntegerField(blank=True)
music_video = models.BooleanField(default=False)
lyrics = models.TextField(blank=True)
def __str__(self):
return self.song_title
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