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 sortedm2m-horizontal-widget
Usage
Add sortedm2m-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 == 'your sortedm2m field name': kwargs['widget'] = SortedFilteredSelectMultiple()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file sortedm2m-horizontal-widget-0.5.0.zip
.
File metadata
- Download URL: sortedm2m-horizontal-widget-0.5.0.zip
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba03d6a965aadecd8404276c1d6067abfd93b62032f194f05dbb55c5f2acc1dc |
|
MD5 | 511c654c004e589677c9c0df4789913c |
|
BLAKE2b-256 | 9a87e62ce11d3531e3d61f2a8c1130ea5ae3e49bb2c85a6dc081bc47b70d38b4 |