X-Git-Url: http://gitweb.fperrin.net/?p=djsite.git;a=blobdiff_plain;f=quotes%2Fadmin.py;h=4e225dc04af88764bac5b4283c33bcc5cc44b870;hp=7e8f1adfb3a778ba4174032b6b06b8215e300ecd;hb=0b43566359216637a28247d7f9ab4121931843ed;hpb=1beb1e7de4e076707eedf1be7386b238f19aeb60 diff --git a/quotes/admin.py b/quotes/admin.py index 7e8f1ad..4e225dc 100644 --- a/quotes/admin.py +++ b/quotes/admin.py @@ -1,8 +1,26 @@ from django.contrib import admin # Register your models here. -from .models import Tag, Author, Work, Quote -admin.site.register(Tag) -admin.site.register(Author) -admin.site.register(Work) -admin.site.register(Quote) +from .models import AuthorTag, WorkTag, QuoteTag, Author, Work, Quote + +@admin.register(Author) +class AuthorAdmin(admin.ModelAdmin): + fields = ('name', 'birth_date', 'death_date', 'tags', + 'notes', 'pvt_notes', 'creation_date', 'last_modification') + readonly_fields = ('creation_date', 'last_modification') + +@admin.register(Work) +class WorkAdmin(admin.ModelAdmin): + fields = ('name', 'author', 'date', 'tags', + 'notes', 'pvt_notes', 'creation_date', 'last_modification') + readonly_fields = ('creation_date', 'last_modification') + +@admin.register(Quote) +class QuoteAdmin(admin.ModelAdmin): + fields = ('text', 'work', 'tags', + 'notes', 'pvt_notes', 'creation_date', 'last_modification') + readonly_fields = ('creation_date', 'last_modification') + +admin.site.register(AuthorTag) +admin.site.register(WorkTag) +admin.site.register(QuoteTag)