Commit 112824b6 authored by Brian Guadalupe's avatar Brian Guadalupe

Add admin screen

parent a9c2f353
from django.contrib import admin from django.contrib import admin
from core.models import *
# Register your models here. # Register your models here.
class AlbumAdmin(admin.ModelAdmin):
list_display = ('album_name', 'artist', 'year')
class ArtistAdmin(admin.ModelAdmin):
list_display = ('id', 'name')
class SongAdmin(admin.ModelAdmin):
list_display = ('song_name', 'artist_name', 'artist_id')
def artist_id(self, obj):
return obj.artist.id
def artist_name(self, obj):
return obj.artist.name
admin.site.register(Album, AlbumAdmin)
admin.site.register(Song, SongAdmin)
admin.site.register(Artist, ArtistAdmin)
\ 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