Load inline widgets for deck editing

This commit is contained in:
Correl Roush 2010-09-23 14:32:51 -04:00
parent db6cf9ab68
commit 2b7f144420

View file

@ -1,10 +1,16 @@
from mtgweb.analyzer.models import Deck, Card, CardType from mtgweb.analyzer.models import *
from django.contrib import admin from django.contrib import admin
class IncludedInline(admin.TabularInline):
model = Included
extra = 1
class CardAdmin(admin.ModelAdmin): class CardAdmin(admin.ModelAdmin):
inlines = (IncludedInline,)
search_fields = ['name'] search_fields = ['name']
list_filter = ['type'] list_filter = ['type']
class DeckAdmin(admin.ModelAdmin):
inlines = (IncludedInline,)
admin.site.register(Card, CardAdmin) admin.site.register(Card, CardAdmin)
admin.site.register(Deck) admin.site.register(Deck, DeckAdmin)
admin.site.register(CardType) admin.site.register(CardType)