29 lines
706 B
Python
29 lines
706 B
Python
# -*- 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):
|
|
search_fields = ['title', 'authors__name', 'languages__name']
|
|
list_display = ('title', 'version', 'file')
|
|
list_filter = ('authors', )
|
|
filter_horizontal = ('authors', )
|
|
|
|
admin.site.register(models.Text, TextAdmin)
|
|
|
|
|
|
class AuthorAdmin(admin.ModelAdmin):
|
|
search_fields = ['name']
|
|
list_display = ('name', 'name_sort')
|
|
admin.site.register(models.Author, AuthorAdmin)
|
|
|
|
|
|
class LanguageAdmin(admin.ModelAdmin):
|
|
search_fields = ['name']
|
|
list_display = ('name', )
|
|
admin.site.register(models.Language, LanguageAdmin)
|
|
|