Skip to content

Commit

Permalink
customized admin panel w/ classes
Browse files Browse the repository at this point in the history
  • Loading branch information
DahlitzFlorian committed Apr 25, 2017
1 parent ab2b6f6 commit 950ef7d
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions vocab/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,21 @@
from .models import Learnset, Vocabulary


admin.site.register(Learnset)
admin.site.register(Vocabulary)
class VocabularyInline(admin.TabularInline):
model = Vocabulary
extra = 3


class LearnsetAdmin(admin.ModelAdmin):
# define inlines
inlines = [VocabularyInline]

# define search terms
search_fields = ['learnset_name']

# customize list displaying
list_display = ('learnset_name', 'creation_date')


# register in admin panel
admin.site.register(Learnset, LearnsetAdmin)

0 comments on commit 950ef7d

Please sign in to comment.