populated the models with data

parent 3b7d91bc
...@@ -6,6 +6,9 @@ class Artist(models.Model): ...@@ -6,6 +6,9 @@ class Artist(models.Model):
birth_name = models.TextField(default="") birth_name = models.TextField(default="")
bio = models.TextField(max_length=700, default="") bio = models.TextField(max_length=700, default="")
def __str__(self):
return '{}'.format(self.artist_name)
class Album(models.Model): class Album(models.Model):
album_name = models.TextField(default="") album_name = models.TextField(default="")
artist = models.ForeignKey(Artist, on_delete=models.CASCADE) artist = models.ForeignKey(Artist, on_delete=models.CASCADE)
...@@ -14,10 +17,16 @@ class Album(models.Model): ...@@ -14,10 +17,16 @@ class Album(models.Model):
label = models.TextField(default="") label = models.TextField(default="")
song_count = models.IntegerField(default=0) song_count = models.IntegerField(default=0)
def __str__(self):
return '{}'.format(self.album_name)
class Song(models.Model): class Song(models.Model):
song_title = models.TextField(default="") song_title = models.TextField(default="")
artist = models.ForeignKey(Artist, on_delete=models.CASCADE) artist = models.ForeignKey(Artist, on_delete=models.CASCADE)
album = models.ForeignKey(Album, on_delete=models.CASCADE) album = models.ForeignKey(Album, on_delete=models.CASCADE)
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(default="") lyrics = models.TextField(default="")
\ No newline at end of file
def __str__(self):
return '{}'.format(self.song_title)
\ No newline at end of file
No preview for this file type
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