Skip to main content

django-sortedm2m-filter-horizontal-widget

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

What version do I need?

Django Install
< 1.8 0.2
1.8 1.1
>= 1.9 1.2.1
>= 2.0 1.3.2
>= 3.0 latest

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. :

from sortedm2m_filter_horizontal_widget.forms import SortedFilteredSelectMultiple

class MyModelAdmin(admin.ModelAdmin):
    # ...

    def formfield_for_manytomany(self, db_field, request=None, **kwargs):
        if db_field.name == 'your_sortedm2m_field_name':
            kwargs['widget'] = SortedFilteredSelectMultiple()
        return super(MyModelAdmin, self).formfield_for_manytomany(db_field, request, **kwargs)

Todo

  • Automatically assign widget if field is specified in ModelAdmin's filter_horizontal.
  • Add tests

Metadata

Release files for django-sortedm2m-filter-horizontal-widget 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-sortedm2m-filter-horizontal-widget 2.0.0
File Size Uploaded Provenance Actions
django_sortedm2m_filter_horizontal_widget-2.0.0.tar.gz 39.7 kB Without provenance Details for django_sortedm2m_filter_horizontal_widget-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-sortedm2m-filter-horizontal-widget 2.0.0
File Interpreter ABI Platform Actions
django_sortedm2m_filter_horizontal_widget-2.0.0-py3-none-any.whl Python 3 none any Details for django_sortedm2m_filter_horizontal_widget-2.0.0-py3-none-any.whl

Total release size: 81.2 kB

Release files / django_sortedm2m_filter_horizontal_widget-2.0.0.tar.gz

Download URL django_sortedm2m_filter_horizontal_widget-2.0.0.tar.gz
Size 39.7 kB
Tags Source
SHA-256 checksum
How to use checksums
28cca62caa531d436b84f8c6c582fcf94278feec1adf0f5bc6c78cf0f4508f11
BLAKE2b-256 checksum
How to use checksums
25a8ce1f43ce547cbebbc0128823217397e94c96ebe54bc9391b8088ac3a4c9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.10.8 Darwin/21.3.0

Release files / django_sortedm2m_filter_horizontal_widget-2.0.0-py3-none-any.whl

Download URL django_sortedm2m_filter_horizontal_widget-2.0.0-py3-none-any.whl
Size 41.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a5c01aa93f9372efa92cdae6741e582e661423b8864d6dc5c348e7cf31cf6d73
BLAKE2b-256 checksum
How to use checksums
bb776044b0e6302b037fc12af32793b8877d99fe52a42d7b6b1ae7e5b39c5dd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.10.8 Darwin/21.3.0

Security for django-sortedm2m-filter-horizontal-widget 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page