.. _admin:

Admin
=====

.. module:: swingers.admin
   :synopsis: Swingers' custom admin classes.

Swingers' custom admin classes.

Admin
-----

.. currentmodule:: swingers.admin.admin

.. class:: RegionAdmin

    A ModelAdmin class for the Region and District model types.

.. class:: RelatedFieldAdmin

    Enables lookup separators in the `admin.list_display`. ::

        class SomeAdmin(RelatedFieldAdmin):
            list_display = ['related__model__name', 'related__model']

    should work without the usual: ::

            def related__model__name(self, obj):
                return obj.related.model.name
            related__model__name.short_description = "<taken from name.title()>"

    .. note:: Fixes/works around https://code.djangoproject.com/ticket/10743.

.. class:: DetailAdmin

    A ModelAdmin class that adds a detail view for an object. This includes a
    customized ChangeList class :class:`swingers.admin.views.DetailChangeList`.
