]> gitweb.fperrin.net Git - djsite.git/blob - quotes/admin.py
Better implement tags, with separate namespaces
[djsite.git] / quotes / admin.py
1 from django.contrib import admin
2
3 # Register your models here.
4 from .models import AuthorTag, WorkTag, QuoteTag, Author, Work, Quote
5
6 @admin.register(Author)
7 class AuthorAdmin(admin.ModelAdmin):
8     fields = ('name', 'birth_date', 'death_date', 'tags',
9               'notes', 'pvt_notes', 'creation_date', 'last_modification')
10     readonly_fields = ('creation_date', 'last_modification')
11
12 @admin.register(Work)
13 class WorkAdmin(admin.ModelAdmin):
14     fields = ('name', 'author', 'date', 'tags',
15               'notes', 'pvt_notes', 'creation_date', 'last_modification')
16     readonly_fields = ('creation_date', 'last_modification')
17
18 @admin.register(Quote)
19 class QuoteAdmin(admin.ModelAdmin):
20     fields = ('text', 'work', 'tags',
21               'notes', 'pvt_notes', 'creation_date', 'last_modification')
22     readonly_fields = ('creation_date', 'last_modification')
23
24 admin.site.register(AuthorTag)
25 admin.site.register(WorkTag)
26 admin.site.register(QuoteTag)