Skip to content

Instantly share code, notes, and snippets.

@devStepsize
Created April 12, 2016 16:36
Show Gist options
  • Save devStepsize/4ebb14ae1a424dc053663d24e05b61f0 to your computer and use it in GitHub Desktop.
Save devStepsize/4ebb14ae1a424dc053663d24e05b61f0 to your computer and use it in GitHub Desktop.
Template django admin interface. It reads metadata in your models to provide a powerful production-ready interfance that content producers can immediately use to start managing content on your site. Source: https://www.djangoproject.com/start/
from django.contrib import admin
from bands.models import Band, Member
class MemberAdmin(admin.ModelAdmin):
"""Customize the look of the auto-generated admin for the Member model"""
list_display = ('name', 'instrument')
list_filter = ('band',)
admin.site.register(Band) # Use the default options
admin.site.register(Member, MemberAdmin) # Use the customized options
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment