2009-08-28 09:02:20 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vi:si:et:sw=4:sts=4:ts=4
|
|
|
|
# Written 2009 by j@mailb.org
|
|
|
|
|
|
|
|
from django.contrib import admin
|
|
|
|
|
|
|
|
import models
|
|
|
|
|
|
|
|
|
|
|
|
class TextAdmin(admin.ModelAdmin):
|
2009-08-28 10:03:07 +00:00
|
|
|
search_fields = ['title', 'authors__name', 'languages__name']
|
2009-08-28 09:02:20 +00:00
|
|
|
list_display = ('title', 'version', 'file')
|
|
|
|
list_filter = ('authors', )
|
2009-08-29 13:00:33 +00:00
|
|
|
filter_horizontal = ('authors', )
|
|
|
|
|
2009-08-28 09:02:20 +00:00
|
|
|
admin.site.register(models.Text, TextAdmin)
|
|
|
|
|
|
|
|
|
|
|
|
class AuthorAdmin(admin.ModelAdmin):
|
|
|
|
search_fields = ['name']
|
2009-08-28 10:04:09 +00:00
|
|
|
list_display = ('name', 'name_sort')
|
2009-08-28 09:02:20 +00:00
|
|
|
admin.site.register(models.Author, AuthorAdmin)
|
|
|
|
|
|
|
|
|
|
|
|
class LanguageAdmin(admin.ModelAdmin):
|
|
|
|
search_fields = ['name']
|
|
|
|
list_display = ('name', )
|
|
|
|
admin.site.register(models.Language, LanguageAdmin)
|
|
|
|
|