Commit 3344249d authored by Jose Gabriel L. Salas's avatar Jose Gabriel L. Salas

removed Inlines

parent e9dbc970
...@@ -4,11 +4,21 @@ from django.contrib import admin ...@@ -4,11 +4,21 @@ from django.contrib import admin
from .models import Artist, Album, Song from .models import Artist, Album, Song
class AlbumInline(admin.TabularInline):
model = Album
class SongInline(admin.TabularInline):
model = Song
class ArtistAdmin(admin.ModelAdmin): class ArtistAdmin(admin.ModelAdmin):
model = Artist model = Artist
list_display = ('artist_name', 'birth_name', 'monthly_listeners',) list_display = ('artist_name', 'birth_name', 'monthly_listeners',)
search_fields = ('artist_name', 'birth_name',) search_fields = ('artist_name', 'birth_name',)
list_filter = ('artist_name', 'birth_name',) list_filter = ('artist_name', 'birth_name',)
fieldsets = [('Artist Data', {'fields': [('artist_name', 'birth_name'),
'bio', 'monthly_listeners']}), ]
class AlbumAdmin(admin.ModelAdmin): class AlbumAdmin(admin.ModelAdmin):
...@@ -26,6 +36,10 @@ class SongAdmin(admin.ModelAdmin): ...@@ -26,6 +36,10 @@ class SongAdmin(admin.ModelAdmin):
list_filter = ('song_title',) list_filter = ('song_title',)
class ArtistInline(admin.TabularInline):
model = Artist
admin.site.register(Artist, ArtistAdmin) admin.site.register(Artist, ArtistAdmin)
admin.site.register(Album, AlbumAdmin) admin.site.register(Album, AlbumAdmin)
admin.site.register(Song, SongAdmin) admin.site.register(Song, SongAdmin)
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