{ "info": { "author": "Patrick Heneghan", "author_email": "git@discopatrick.me", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 2.0", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "========================================\nDjango Admin Multiple Choice List Filter\n========================================\n\nThe SimpleListFilter that ships with Django only allows you to filter on one\noption at a time. MultipleChoiceListFilter extends SimpleListFilter to allow you\nto filter on multiple options.\n\nGetting started\n---------------\n\nInstall via pip::\n\n pip install django-admin-multiple-choice-list-filter\n\nAdd to INSTALLED_APPS in settings.py::\n\n # project/settings.py\n\n INSTALLED_APPS = [\n ...\n 'django_admin_multiple_choice_list_filter',\n ]\n\nAs an example, let's say you had a ``shop`` app. In that app you have an ``Order`` model with a ``status`` field that has limited choices::\n\n # shop/models.py\n\n from django.db import models\n\n\n class Statuses(object):\n RECEIVED, PROCESSING, SHIPPED, CLOSED = range(0, 4)\n\n CHOICES = (\n (RECEIVED, 'Received'),\n (PROCESSING, 'Processing'),\n (SHIPPED, 'Shipped'),\n (CLOSED, 'Closed'),\n )\n\n\n class Order(models.Model):\n status = models.IntegerField(\n choices=Statuses.CHOICES,\n default=Statuses.RECEIVED,\n )\n\nThen, in your app's admin.py::\n\n # shop/admin.py\n\n from django.contrib import admin\n\n from django_admin_multiple_choice_list_filter.list_filters import MultipleChoiceListFilter\n\n from .models import Order, Statuses\n\n\n class StatusListFilter(MultipleChoiceListFilter):\n title = 'Status'\n parameter_name = 'status__in'\n\n def lookups(self, request, model_admin):\n return Statuses.CHOICES\n\n\n class OrderAdmin(admin.ModelAdmin):\n list_display = ('status',)\n list_filter = (StatusListFilter,)\n\n admin.site.register(Order, OrderAdmin)\n\nYour admin area will now display the MultipleChoiceListFilter. It looks a lot like the\nSimpleListFilter, except there is now an additional link next to each choice. Use these\nlinks to include or exclude the choice from the results. You can mix and match any\ncombination you like.\n\n.. image:: https://raw.githubusercontent.com/ctxis/django-admin-multiple-choice-list-filter/master/django-admin-multiple-choice-list-filter.png\n\nYou can override the default template in one of two ways.\n\n1. Override the template: https://docs.djangoproject.com/en/2.0/howto/overriding-templates/.\n The default template location is ``django_admin_multiple_choice_list_filter/filter.html``\n2. Set the template name in your subclass of MultipleChoiceListFilter, e.g.::\n\n # shop/admin.py\n ...\n\n class StatusListFilter(MultipleChoiceListFilter):\n template = 'path/to/your/template.html'\n ...\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ctxis/django-admin-multiple-choice-list-filter", "keywords": "", "license": "BSD 2-Clause \"Simplified\" License", "maintainer": "", "maintainer_email": "", "name": "django-admin-multiple-choice-list-filter", "package_url": "https://pypi.org/project/django-admin-multiple-choice-list-filter/", "platform": "", "project_url": "https://pypi.org/project/django-admin-multiple-choice-list-filter/", "project_urls": { "Homepage": "https://github.com/ctxis/django-admin-multiple-choice-list-filter" }, "release_url": "https://pypi.org/project/django-admin-multiple-choice-list-filter/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "A Django app to add a Multiple Choice List Filter to the admin interface.", "version": "0.1.1" }, "last_serial": 3868185, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "ce36e02f09b3f11c17fadd2967e7a0be", "sha256": "b62549be2a7e9fbf71c429957d846341923a27fd259837e7ca6d564091589612" }, "downloads": -1, "filename": "django-admin-multiple-choice-list-filter-0.1.tar.gz", "has_sig": false, "md5_digest": "ce36e02f09b3f11c17fadd2967e7a0be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3491, "upload_time": "2018-04-11T12:08:19", "url": "https://files.pythonhosted.org/packages/e5/8c/c2af92f5fc8fa82990bf797ea83142859a6aae56fe1379e27623402d526c/django-admin-multiple-choice-list-filter-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "6cd597e8d30eac893308031ee7b5e4a6", "sha256": "eab2ad5fad6df8ed8436cb6c1d0e67863453a9d30282b7fdcb7e45b2eb37ab6f" }, "downloads": -1, "filename": "django_admin_multiple_choice_list_filter-0.1.1-py2-none-any.whl", "has_sig": false, "md5_digest": "6cd597e8d30eac893308031ee7b5e4a6", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 6760, "upload_time": "2018-05-16T10:46:46", "url": "https://files.pythonhosted.org/packages/99/af/a15bb1c2ab4314f7c1cb4b65f1f9713370205bc0bede9fa14818681eb1df/django_admin_multiple_choice_list_filter-0.1.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c135652968a6cc18b78833e5961ee423", "sha256": "a5b82682ff752cf74bbc4fa3d562c99b9f9f80389961017e1ac63e08f22d8b9f" }, "downloads": -1, "filename": "django-admin-multiple-choice-list-filter-0.1.1.tar.gz", "has_sig": false, "md5_digest": "c135652968a6cc18b78833e5961ee423", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4527, "upload_time": "2018-05-16T10:46:48", "url": "https://files.pythonhosted.org/packages/86/52/59664dade0552d6e2c76b5b1e94ea73b5390e8c4dcdf14d368f805a28ee4/django-admin-multiple-choice-list-filter-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6cd597e8d30eac893308031ee7b5e4a6", "sha256": "eab2ad5fad6df8ed8436cb6c1d0e67863453a9d30282b7fdcb7e45b2eb37ab6f" }, "downloads": -1, "filename": "django_admin_multiple_choice_list_filter-0.1.1-py2-none-any.whl", "has_sig": false, "md5_digest": "6cd597e8d30eac893308031ee7b5e4a6", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 6760, "upload_time": "2018-05-16T10:46:46", "url": "https://files.pythonhosted.org/packages/99/af/a15bb1c2ab4314f7c1cb4b65f1f9713370205bc0bede9fa14818681eb1df/django_admin_multiple_choice_list_filter-0.1.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c135652968a6cc18b78833e5961ee423", "sha256": "a5b82682ff752cf74bbc4fa3d562c99b9f9f80389961017e1ac63e08f22d8b9f" }, "downloads": -1, "filename": "django-admin-multiple-choice-list-filter-0.1.1.tar.gz", "has_sig": false, "md5_digest": "c135652968a6cc18b78833e5961ee423", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4527, "upload_time": "2018-05-16T10:46:48", "url": "https://files.pythonhosted.org/packages/86/52/59664dade0552d6e2c76b5b1e94ea73b5390e8c4dcdf14d368f805a28ee4/django-admin-multiple-choice-list-filter-0.1.1.tar.gz" } ] }