1 from django.contrib import admin
2 from django.utils.translation import ugettext_lazy as _
4 from toolbar import models
7 class ButtonGroupAdmin(admin.ModelAdmin):
8 list_display = ('name', 'slug', 'position',)
9 search_fields = ('name', 'slug',)
10 prepopulated_fields = {'slug': ('name',)}
11 list_editable = ('position',)
13 admin.site.register(models.ButtonGroup, ButtonGroupAdmin)
16 class ButtonAdmin(admin.ModelAdmin):
17 list_display = ('label', 'slug', 'tag', 'key', 'position',)
18 list_filter = ('group',)
19 search_fields = ('label', 'slug', 'tag', 'key',)
20 prepopulated_fields = {'slug': ('label',)}
21 filter_horizontal = ('group',)
22 list_editable = ('position',)
24 admin.site.register(models.Button, ButtonAdmin)