fixes #4475: Split thema into separate fields.
[redakcja.git] / src / wlxml / admin.py
1 from django.contrib import admin
2 from . import models
3
4
5 class AttributeInline(admin.TabularInline):
6     model = models.Attribute
7
8
9 @admin.register(models.Tag)
10 class TagAdmin(admin.ModelAdmin):
11     inlines = [AttributeInline]
12     list_display = ['name', 'type']
13     list_filter = ['type']
14     fieldsets = [
15         (None, {
16             'fields': [
17                 'name',
18                 'type',
19                 'similar_to',
20                 'description',
21                 'example',
22             ]
23         }),
24         ('Editor style', {
25             'fields': [
26                 'editor_css', 'editor_css_after',
27             ]
28         }),
29     ]
30
31
32
33 @admin.register(models.TagUsage)
34 class TagUsageAdmin(admin.ModelAdmin):
35     list_filter = ['tag']
36
37
38 @admin.register(models.AttributeUsage)
39 class AttributeUsageAdmin(admin.ModelAdmin):
40     list_filter = ['attribute__tag', 'attribute']
41     list_display = ['tag_usage', 'attribute', 'value']