Load inline widgets for deck editing
This commit is contained in:
parent
db6cf9ab68
commit
2b7f144420
1 changed files with 8 additions and 2 deletions
|
@ -1,10 +1,16 @@
|
|||
from mtgweb.analyzer.models import Deck, Card, CardType
|
||||
from mtgweb.analyzer.models import *
|
||||
from django.contrib import admin
|
||||
|
||||
class IncludedInline(admin.TabularInline):
|
||||
model = Included
|
||||
extra = 1
|
||||
class CardAdmin(admin.ModelAdmin):
|
||||
inlines = (IncludedInline,)
|
||||
search_fields = ['name']
|
||||
list_filter = ['type']
|
||||
class DeckAdmin(admin.ModelAdmin):
|
||||
inlines = (IncludedInline,)
|
||||
|
||||
admin.site.register(Card, CardAdmin)
|
||||
admin.site.register(Deck)
|
||||
admin.site.register(Deck, DeckAdmin)
|
||||
admin.site.register(CardType)
|
||||
|
|
Loading…
Reference in a new issue