kavanland
clone your own copy | download snapshot

Snapshots | iceberg

No images in this repository’s iceberg at this time

Inside this repository

admin.py
text/x-python

Download raw (1.4 KB)

# This file is part of Active Archives.
# Copyright 2006-2011 the Active Archives contributors (see AUTHORS)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
# Also add information on how to contact you by electronic and paper mail.


"""
Active Archives aacore admin site.
"""


from django.contrib import admin
from aacore.models import Namespace, Annotation


class NamespaceAdmin(admin.ModelAdmin):
    ordering = ("name",)
    list_display = ("name", "url", "color")
    search_fields = ("name", "url")
    list_editable = ("color",)


class AnnotationAdmin(admin.ModelAdmin):
    list_display = ("resource", "__unicode__", "order")
    list_display_links = ("__unicode__",)
    list_filter = ("resource",)
    list_editable = ("resource", "order",)


admin.site.register(Namespace, NamespaceAdmin)
admin.site.register(Annotation, AnnotationAdmin)