Update models.py

parent 8bdc9d91
...@@ -5,6 +5,9 @@ class Artist(models.Model): ...@@ -5,6 +5,9 @@ class Artist(models.Model):
monthly_listeners = models.IntegerField() monthly_listeners = models.IntegerField()
birth_name = models.CharField(max_length=50, null=True) birth_name = models.CharField(max_length=50, null=True)
bio = models.TextField(null=True) bio = models.TextField(null=True)
def __str__(self):
return self.artist_name
class Album(models.Model): class Album(models.Model):
album_name = models.CharField(max_length=50) album_name = models.CharField(max_length=50)
...@@ -13,6 +16,9 @@ class Album(models.Model): ...@@ -13,6 +16,9 @@ class Album(models.Model):
release_date = models.CharField(max_length=50) release_date = models.CharField(max_length=50)
label = models.CharField(max_length=50, null=True) label = models.CharField(max_length=50, null=True)
song_count = models.IntegerField(null=True) song_count = models.IntegerField(null=True)
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)
...@@ -20,4 +26,7 @@ class Song(models.Model): ...@@ -20,4 +26,7 @@ class Song(models.Model):
album = models.ForeignKey(Album, on_delete=models.CASCADE) album = models.ForeignKey(Album, on_delete=models.CASCADE)
song_length = models.IntegerField() song_length = models.IntegerField()
music_video = models.BooleanField(null=True) music_video = models.BooleanField(null=True)
lyrics = models.TextField(max_length=10000, null=True) lyrics = models.TextField(max_length=10000, null=True)
\ No newline at end of file
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