Modified admin list view

parent b3dc6b39
No preview for this file type
......@@ -12,9 +12,17 @@ class ArtistAdmin(admin.ModelAdmin):
class AlbumAdmin(admin.ModelAdmin):
model = Album
search_fields = ('album_name', 'artist',)
list_display = ('album_name', 'artist',)
list_filter = ('album_name', 'artist',)
class SongAdmin(admin.ModelAdmin):
model = Song
search_fields = ('album', 'artist', 'song_title',)
list_display = ('album', 'artist', 'song_title',)
list_filter = ('album', 'artist', 'song_title',)
admin.site.register(Artist, ArtistAdmin)
admin.site.register(Album, AlbumAdmin)
admin.site.register(Song, SongAdmin)
\ No newline at end of file
# Generated by Django 4.1.7 on 2023-02-21 14:34
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('homepage', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='album',
name='label',
field=models.CharField(blank=True, max_length=200, null=True),
),
migrations.AddField(
model_name='album',
name='song_count',
field=models.IntegerField(blank=True, null=True),
),
migrations.AddField(
model_name='artist',
name='bio',
field=models.TextField(blank=True, max_length=700, null=True),
),
migrations.AddField(
model_name='artist',
name='birth_name',
field=models.TextField(blank=True, null=True),
),
migrations.AddField(
model_name='song',
name='lyrics',
field=models.TextField(blank=True, null=True),
),
migrations.AddField(
model_name='song',
name='music_video',
field=models.BooleanField(default=False),
),
migrations.AlterField(
model_name='album',
name='album_name',
field=models.CharField(blank=True, max_length=50, null=True),
),
migrations.AlterField(
model_name='album',
name='artist',
field=models.CharField(blank=True, max_length=50, null=True),
),
migrations.AlterField(
model_name='album',
name='description',
field=models.TextField(blank=True, null=True),
),
migrations.AlterField(
model_name='album',
name='release_date',
field=models.CharField(blank=True, max_length=20, null=True),
),
migrations.AlterField(
model_name='artist',
name='artist_name',
field=models.CharField(blank=True, max_length=50, null=True),
),
migrations.AlterField(
model_name='artist',
name='monthly_listeners',
field=models.IntegerField(blank=True, null=True),
),
migrations.AlterField(
model_name='song',
name='album',
field=models.CharField(blank=True, max_length=50, null=True),
),
migrations.AlterField(
model_name='song',
name='artist',
field=models.CharField(blank=True, max_length=50, null=True),
),
migrations.AlterField(
model_name='song',
name='song_length',
field=models.IntegerField(blank=True, null=True),
),
migrations.AlterField(
model_name='song',
name='song_title',
field=models.CharField(blank=True, max_length=50, null=True),
),
]
from django.db import models
class Artist(models.Model):
artist_name = models.CharField(max_length=50)
monthly_listeners = models.IntegerField()
birth_name = models.TextField()
bio = models.TextField(max_length=700)
artist_name = models.CharField(max_length=50, blank=True, null=True)
monthly_listeners = models.IntegerField(blank=True, null=True)
birth_name = models.TextField(blank=True, null=True)
bio = models.TextField(max_length=700, blank=True, null=True)
class Album(models.Model):
album_name = models.CharField(max_length=50)
artist = models.CharField(max_length=50)
description = models.TextField()
release_date = models.CharField(max_length=20)
label = models.CharField(max_length=50)
song_count = models.IntegerField()
album_name = models.CharField(max_length=50, blank=True, null=True)
artist = models.CharField(max_length=50, blank=True, null=True)
description = models.TextField(blank=True, null=True)
release_date = models.CharField(max_length=20, blank=True, null=True)
label = models.CharField(max_length=200, blank=True, null=True)
song_count = models.IntegerField(blank=True, null=True)
class Song(models.Model):
song_title = models.CharField(max_length=50)
artist = models.CharField(max_length=50)
album = models.CharField(max_length=50)
song_length = models.IntegerField()
song_title = models.CharField(max_length=50, blank=True, null=True)
artist = models.CharField(max_length=50, blank=True, null=True)
album = models.CharField(max_length=50, blank=True, null=True)
song_length = models.IntegerField(blank=True, null=True)
music_video = models.BooleanField(default=False)
lyrics = models.TextField()
\ No newline at end of file
lyrics = models.TextField(blank=True, null=True)
\ 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