Commit 29595899 authored by Ysabella Panghulan's avatar Ysabella Panghulan

edited the list display for Song model

parent d5dbafa3
...@@ -17,7 +17,7 @@ class AlbumAdmin(admin.ModelAdmin): ...@@ -17,7 +17,7 @@ class AlbumAdmin(admin.ModelAdmin):
class SongAdmin(admin.ModelAdmin): class SongAdmin(admin.ModelAdmin):
model = Song model = Song
list_display = ('song_title', 'song_length', 'music_video', 'lyrics') list_display = ('song_title', 'song_length', 'lyrics', 'music_video')
search_fields = ['song_title', 'lyrics'] search_fields = ['song_title', 'lyrics']
list_filter = ('song_title', ) list_filter = ('song_title', )
......
...@@ -6,6 +6,9 @@ class Artist(models.Model): ...@@ -6,6 +6,9 @@ class Artist(models.Model):
birth_name = models.CharField(max_length = 50, null = True, blank = True) birth_name = models.CharField(max_length = 50, null = True, blank = True)
bio = models.TextField(max_length = 700, null = True, blank = True) bio = models.TextField(max_length = 700, null = True, blank = True)
def __str__(self):
return self.artist_name
class Album(models.Model): class Album(models.Model):
album_name = models.CharField(max_length = 255) album_name = models.CharField(max_length = 255)
...@@ -14,6 +17,9 @@ class Album(models.Model): ...@@ -14,6 +17,9 @@ class Album(models.Model):
release_date = models.DateField('release date') release_date = models.DateField('release date')
label = models.CharField(max_length = 255, null=True, blank=True) label = models.CharField(max_length = 255, null=True, blank=True)
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)
...@@ -21,4 +27,7 @@ class Song(models.Model): ...@@ -21,4 +27,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(default = 0) song_length = models.IntegerField(default = 0)
music_video = models.BooleanField(default=False) music_video = models.BooleanField(default=False)
lyrics = models.TextField(null=True, blank=True) lyrics = models.TextField(null=True, blank=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