Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for sortedm2m-horizontal-widget, version 0.5.0
Filename, size File type Python version Upload date Hashes
Filename, size sortedm2m-horizontal-widget-0.5.0.zip (14.6 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page