Horizontal filter widget for django-sortedm2m
Project description
sortedm2m-filter-horizontal-widget is an admin widget for Gregor Mülleggers excellent django-sortedm2m library.
This allows for a familiar filter horizontal widget.
Installation
pip install django-sortedm2m-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()
Todo
Automatically assign widget if field is specified in ModelAdmin’s filter_horizontal.
Add tests
Changelog
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
Close
Hashes for django-sortedm2m-filter-horizontal-widget-0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | eed5467ede6ba01747a7181610e4ab464979c165234d7465781358ac1d6129f8 |
|
MD5 | 8e7ab4e5146c7106a432755e9cd71821 |
|
BLAKE2b-256 | c1fac2bf7b97682d87eb7b6a2ed4e9b54dd035d0d867e2125c31f8105531f20c |