Metadata-Version: 2.0
Name: django-admin-utils
Version: 0.3.0
Summary: Utility code and patterns.
Home-page: https://github.com/ionelmc/django-admin-utils
Author: Ionel Cristian Maries
Author-email: contact@ionelmc.ro
License: BSD
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: Unix
Classifier: Operating System :: POSIX
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Utilities
Requires-Dist: Django (>=1.1)

===========================
    django-admin-utils
===========================

| |docs| |travis| |appveyor| |coveralls| |landscape| |scrutinizer|
| |version| |downloads| |wheel| |supported-versions| |supported-implementations|

.. |docs| image:: https://readthedocs.org/projects/django-admin-utils/badge/?style=flat
    :target: https://readthedocs.org/projects/django-admin-utils
    :alt: Documentation Status

.. |travis| image:: http://img.shields.io/travis/ionelmc/django-admin-utils/master.png?style=flat
    :alt: Travis-CI Build Status
    :target: https://travis-ci.org/ionelmc/django-admin-utils

.. |appveyor| image:: https://ci.appveyor.com/api/projects/status/github/ionelmc/django-admin-utils?branch=master
    :alt: AppVeyor Build Status
    :target: https://ci.appveyor.com/project/ionelmc/django-admin-utils

.. |coveralls| image:: http://img.shields.io/coveralls/ionelmc/django-admin-utils/master.png?style=flat
    :alt: Coverage Status
    :target: https://coveralls.io/r/ionelmc/django-admin-utils

.. |landscape| image:: https://landscape.io/github/ionelmc/django-admin-utils/master/landscape.svg?style=flat
    :target: https://landscape.io/github/ionelmc/django-admin-utils/master
    :alt: Code Quality Status

.. |version| image:: http://img.shields.io/pypi/v/django-admin-utils.png?style=flat
    :alt: PyPI Package latest release
    :target: https://pypi.python.org/pypi/django-admin-utils

.. |downloads| image:: http://img.shields.io/pypi/dm/django-admin-utils.png?style=flat
    :alt: PyPI Package monthly downloads
    :target: https://pypi.python.org/pypi/django-admin-utils

.. |wheel| image:: https://pypip.in/wheel/django-admin-utils/badge.png?style=flat
    :alt: PyPI Wheel
    :target: https://pypi.python.org/pypi/django-admin-utils

.. |supported-versions| image:: https://pypip.in/py_versions/django-admin-utils/badge.png?style=flat
    :alt: Supported versions
    :target: https://pypi.python.org/pypi/django-admin-utils

.. |supported-implementations| image:: https://pypip.in/implementation/django-admin-utils/badge.png?style=flat
    :alt: Supported imlementations
    :target: https://pypi.python.org/pypi/django-admin-utils

.. |scrutinizer| image:: https://img.shields.io/scrutinizer/g/ionelmc/django-admin-utils/master.png?style=flat
    :alt: Scrtinizer Status
    :target: https://scrutinizer-ci.com/g/ionelmc/django-admin-utils/

Utility code and patterns. 

Requirements
============

:OS: Any
:Runtime: Python 2.6, 2.7, 3.2, 3.3 or PyPy
:Packages: Django>=1.4 (including 1.7); Django>=1.1 probably works but it's not tested, those releases should not be used (they are insecure).

Terse admin.py
==============

::

    from django.contrib import admin
    from admin_utils import register, inline

    from .models import MyModel, OtherModel

    @register(MyModel)
    class MyModelAdmin(admin.ModelAdmin):
        inlines = inline(OtherModel),

If you want custom admin sites::

    customsite = admin.AdminSite()

    @register(MyModel, site=customsite)
    class MyModelAdmin(admin.ModelAdmin):
        inlines = inline(OherModel),


Mock admin (mount your views in admin using model wrappers)
===========================================================

Have you ever wanted a page in the admin that appears in the app list but you don't have any
models ? Now you can have that without patching up the admin Site or the templates. Just put this
in your admin.py::

    from django.conf.urls import patterns, url
    from admin_utils import make_admin_class

    make_admin_class("Test1", patterns("test_app.views",
        url(r'^$', 'root', name='test_app_test1_changelist'),
        url(r'^level1/$', 'level1', name='level-1'),
        url(r'^level1/level2/$', 'level2', name='level-2'),
    ), "test_app")

To use different admin site::

    make_admin_class("Test1", patterns("test_app.views",
        url(r'^$', 'root', name='test_app_test1_changelist'),
        url(r'^level1/$', 'level1', name='level-1'),
        url(r'^level1/level2/$', 'level2', name='level-2'),
    ), "test_app", site=customsite)

Admin mixins
============

admin_utils.mixins.FoldableListFilterAdminMixin
-----------------------------------------------

Adds nice filter toggling with cookie support. Largely based on `django-foldable-list-filter
<https://bitbucket.org/Stanislas/django-foldable-list-filter>`_ but without the transition effect and no pictures.

Example::

    from admin_utils.mixins import FoldableListFilterAdminMixin

    class MyModelAdmin(FoldableListFilterAdminMixin, admin.ModelAdmin):
        pass

Looks like this:

    .. image:: docs/FoldableListFilterAdminMixin.png
       :alt: Screenshort of FoldableListFilterAdminMixin

admin_utils.mixins.FullWidthAdminMixin
--------------------------------------

Make the changelist expand instead of having the width of the windows and having that nasty inner scrollbar. You never gonna notice that if
your table is long !

Example::

    from admin_utils.mixins import FoldableListFilterAdminMixin

    class MyModelAdmin(FoldableListFilterAdminMixin, admin.ModelAdmin):
        pass

You probably didn't even notice you had this problem:

.. image:: docs/FullWidthAdminMixin.png
   :alt: Screenshort of FullWidthAdminMixin





