Horizontal filter widget for django-sortedm2m
Project description
=========================================
django-sortedm2m-filter-horizontal-widget
=========================================
``sortedm2m-filter-horizontal-widget`` is an admin widget for Gregor Mülleggers excellent django-sortedm2m_ library.
.. _django-sortedm2m: http://github.com/gregmuellegger/django-sortedm2m
This allows for a familiar filter horizontal widget.
Usage
=====
Add ``sortedm2m-filter-horizontal-widget`` to your ``INSTALLED_APPS``. (needed for static files)
In your ``ModelAdmin`` add the following function to override the default widget.
def formfield_for_manytomany(self, db_field, request=None, **kwargs):
if db_field.name == 'sortedm2m_field_name':
kwargs['widget'] = SortedFilteredSelectMultiple()
django-sortedm2m-filter-horizontal-widget
=========================================
``sortedm2m-filter-horizontal-widget`` is an admin widget for Gregor Mülleggers excellent django-sortedm2m_ library.
.. _django-sortedm2m: http://github.com/gregmuellegger/django-sortedm2m
This allows for a familiar filter horizontal widget.
Usage
=====
Add ``sortedm2m-filter-horizontal-widget`` to your ``INSTALLED_APPS``. (needed for static files)
In your ``ModelAdmin`` add the following function to override the default widget.
def formfield_for_manytomany(self, db_field, request=None, **kwargs):
if db_field.name == 'sortedm2m_field_name':
kwargs['widget'] = SortedFilteredSelectMultiple()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-sortedm2m-filter-horizontal-widget-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45a04a956835cf22c2136a8adbcddb1ad4ce39d026e15edb1e2b7321e4cd823b |
|
MD5 | 8359ebf8619337d8a0d672735001e37b |
|
BLAKE2b-256 | 1a9e8036aaa6904b8eec877a120a19297e842e331e35052f8cfb80b5f502c53f |
Close
Hashes for django_sortedm2m_filter_horizontal_widget-0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33fc2f542cc5a79d38136e86f22e36af2ca7869c3435f99204ba359c8ce0346b |
|
MD5 | d8f87e2cb60c62836434848a27637a9a |
|
BLAKE2b-256 | c2bb3f12cfa24d0597f3e583eb3beaac4e4be5a5cd519376a5766f9ad6051d2e |