{ "info": { "author": "Maxim Musayev", "author_email": "shamanu4@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Internet :: WWW/HTTP", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "dal_admin_filters\n=================\n\nDjango-autocomplete-light filters for django admin.\n---------------------------------------------------\n\n - default select2 widget\n\n .. figure:: https://raw.githubusercontent.com/shamanu4/dal_admin_filters/master/shot_01.png\n :alt: Admin filter with Select2 input\n\n - widget with filter title as placeholder\n\n .. figure:: https://raw.githubusercontent.com/shamanu4/dal_admin_filters/master/shot_02.png\n :alt: Admin filter with Select2 input and placeholder title\n\n\nRequirements\n------------\n\nThis is extension for django-autocomplete-light so you need to install\nand configure it too.\n\nHere will be minimum setup for example.\n\nRefer to http://django-autocomplete-light.readthedocs.io/ for more\ndetailed instructions.\n\nInstallation\n------------\n\n- Install using pip\n\n .. code::\n\n pip install django-autocomplete-light dal_admin_filters\n\n- Update INSTALLED\\_APPS. You need too put django-autocomplete-light before admin\n\n .. code:: python\n\n INSTALLED_APPS = [\n 'dal',\n 'dal_select2',\n 'dal_admin_filters',\n #\n 'django.contrib.admin',\n ... other stuff there ...\n ]\n\nConfiguration\n-------------\n\n- Create autocomplete view\n\n - Let our models look like this\n\n .. code:: python\n\n class Country(models.Model):\n name = models.CharField(max_length=100, unique=True)\n\n def __str__(self):\n return self.name\n\n\n class Person(models.Model):\n name = models.CharField(max_length=100, unique=True)\n from_country = models.ForeignKey(Country)\n\n def __str__(self):\n return self.name\n\n - Then autocomplete view for country selection will be similar to next\n\n .. code:: python\n\n from dal import autocomplete\n from your_countries_app.models import Country\n\n class CountryAutocomplete(autocomplete.Select2QuerySetView):\n def get_queryset(self):\n # Don't forget to filter out results depending on the visitor !\n if not self.request.user.is_authenticated():\n return Country.objects.none()\n\n qs = Country.objects.all()\n\n if self.q:\n qs = qs.filter(name__istartswith=self.q)\n\n return qs\n\n- Register view in urls.py\n\n .. code:: python\n\n from your_countries_app.views import CountryAutocomplete\n\n urlpatterns = [\n url(\n r'^country-autocomplete/$',\n CountryAutocomplete.as_view(),\n name='country-autocomplete',\n ),\n url(r'^admin/', admin.site.urls),\n ]\n\n- Use filter in your admin.py\n\n .. code:: python\n\n from django.contrib import admin\n from your_countries_app.models import Country, Person\n from dal_admin_filters import AutocompleteFilter\n\n\n @admin.register(Country)\n class CountryAdmin(admin.ModelAdmin):\n pass\n\n\n class CountryFilter(AutocompleteFilter):\n title = 'Country from' # filter's title\n field_name = 'from_country' # field name - ForeignKey to Country model\n autocomplete_url = 'country-autocomplete' # url name of Country autocomplete view\n\n\n class CountryPlaceholderFilter(AutocompleteFilter):\n title = 'Country from' # filter's title\n field_name = 'from_country' # field name - ForeignKey to Country model\n autocomplete_url = 'country-autocomplete' # url name of Country autocomplete view\n is_placeholder_title = True # filter title will be shown as placeholder\n\n\n class CountryCustomPlaceholderFilter(AutocompleteFilter):\n title = 'Country from' # filter's title\n parameter_name = 'from_country' # field name - ForeignKey to Country model\n autocomplete_url = 'country-autocomplete' # url name of Country autocomplete view\n widget_attrs = {\n 'data-placeholder': 'Filter by country name'\n }\n\n\n @admin.register(Person)\n class PersonAdmin(admin.ModelAdmin):\n class Media: # Empty media class is required if you are using autocomplete filter\n pass # If you know better solution for altering admin.media from filter instance\n # - please contact me or make a pull request\n\n list_filter = [CountryFilter]\n\n\nIf setup is done right, you will see the Select2 widget in admin filter\nin Person's changelist view.\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/shamanu4/dal_admin_filters", "keywords": "django autocomplete admin filters", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "dal-admin-filters", "package_url": "https://pypi.org/project/dal-admin-filters/", "platform": "", "project_url": "https://pypi.org/project/dal-admin-filters/", "project_urls": { "Homepage": "https://github.com/shamanu4/dal_admin_filters" }, "release_url": "https://pypi.org/project/dal-admin-filters/0.3.3/", "requires_dist": [ "django-autocomplete-light" ], "requires_python": "", "summary": "Django autocomplete light filters for django admin", "version": "0.3.3" }, "last_serial": 4829470, "releases": { "0.1": [], "0.1.1": [ { "comment_text": "", "digests": { "md5": "aa0a6930beecfe6c740ed03d24a82e4f", "sha256": "d6fd4110126a71ce4492e9deee6b244f8cc83e92898ca86754f9cdce4b9d67c1" }, "downloads": -1, "filename": "dal_admin_filters-0.1.1.tar.gz", "has_sig": false, "md5_digest": "aa0a6930beecfe6c740ed03d24a82e4f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1484, "upload_time": "2016-08-30T13:22:42", "url": "https://files.pythonhosted.org/packages/0d/4c/599928eccd36c3e08abcebc5dc1b6626f314e60d7fd1575accb10a919a8b/dal_admin_filters-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "ac0ac0ab8837c535f2fa6e4ad732b52b", "sha256": "eab4651cc0d94abd59a2bb451966e5d10705974b18762fe4698112f282365835" }, "downloads": -1, "filename": "dal_admin_filters-0.1.2.tar.gz", "has_sig": false, "md5_digest": "ac0ac0ab8837c535f2fa6e4ad732b52b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2250, "upload_time": "2016-08-30T13:33:52", "url": "https://files.pythonhosted.org/packages/29/c3/2f00374ecb6340fe35a7ebc8f14ad4d4bd4ec18b161a7f624a18c40d61ca/dal_admin_filters-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "1da20d2df6af0bce549d00454bfd2c86", "sha256": "eab2c5ff4a56568e7e2577086927121fd42c94535ef83b21d4395459f7e7fa8e" }, "downloads": -1, "filename": "dal_admin_filters-0.1.3.tar.gz", "has_sig": false, "md5_digest": "1da20d2df6af0bce549d00454bfd2c86", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3625, "upload_time": "2016-08-30T13:43:46", "url": "https://files.pythonhosted.org/packages/4d/d4/359614c0404cc0b3d85eb3781c3482891ce8ac8ec268c552f7057349e820/dal_admin_filters-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "afadae8b0076cd6c96b46a6af2bc35fe", "sha256": "5c6a478126dd89f0da5efae78cf65bf043448550f9be08673a9aa358992b360b" }, "downloads": -1, "filename": "dal_admin_filters-0.1.4.tar.gz", "has_sig": false, "md5_digest": "afadae8b0076cd6c96b46a6af2bc35fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4952, "upload_time": "2016-08-30T15:24:43", "url": "https://files.pythonhosted.org/packages/a8/ab/da8fd0d1948aac0b42324159d4286bd0d99b9949926e1ac3e898e9c94133/dal_admin_filters-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "a8bcf7a7540021cde63718d42472b257", "sha256": "19e346186c10ed76af84b051ca50d1ef11b40525086b3f2d954938f6cec50d8e" }, "downloads": -1, "filename": "dal_admin_filters-0.1.5.tar.gz", "has_sig": false, "md5_digest": "a8bcf7a7540021cde63718d42472b257", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5036, "upload_time": "2016-08-30T15:54:11", "url": "https://files.pythonhosted.org/packages/98/e4/9afb0b50391ff6f12b88a5bb9b6efbbe0b8aea1f6f1c1636122c8fb20f29/dal_admin_filters-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "0e04d4c72ded62f7297df9b7a1e5fd24", "sha256": "c124598c7c10a559b8c5e9ca9dc9ae377ac96f23014259829d791745dc67381c" }, "downloads": -1, "filename": "dal_admin_filters-0.1.6.tar.gz", "has_sig": false, "md5_digest": "0e04d4c72ded62f7297df9b7a1e5fd24", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5448, "upload_time": "2016-08-30T16:18:16", "url": "https://files.pythonhosted.org/packages/07/9b/ba1743800bd3bd7f13b65a9d32ea464bbd6f718af5838ee4673058a09642/dal_admin_filters-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "3c03c3054fb9f100a30c62be153060d4", "sha256": "b6a2a8dfb0b98505ddf1254cc99b42a32fffa813aec73f51e342238ae5b7a4ce" }, "downloads": -1, "filename": "dal_admin_filters-0.1.7.tar.gz", "has_sig": false, "md5_digest": "3c03c3054fb9f100a30c62be153060d4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5676, "upload_time": "2016-10-27T09:29:45", "url": "https://files.pythonhosted.org/packages/d5/cd/0d1bbe7afd645d20fc5c5a302aa6baa64d6add34199990caf83bb0a381d3/dal_admin_filters-0.1.7.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "0917906405d2cbbd05ec74fa82fa0ea7", "sha256": "9e7fc468e7ca12f5e844078e9667484bd476132a08ba33779d67e30fe6bc0813" }, "downloads": -1, "filename": "dal_admin_filters-0.2.0.tar.gz", "has_sig": false, "md5_digest": "0917906405d2cbbd05ec74fa82fa0ea7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21807, "upload_time": "2017-08-09T07:10:59", "url": "https://files.pythonhosted.org/packages/44/13/2c6c14d9e7a1330f8feab7a65c0f1c3cdc7ffc57f6c6c25a9cde13ee6429/dal_admin_filters-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "4cf6c6f024bd3d947c56be6b982b0f89", "sha256": "c23efd9d739050622bb74c9a0c1603158c9c0f5231b320cab275bfbbfaf76299" }, "downloads": -1, "filename": "dal_admin_filters-0.2.1.tar.gz", "has_sig": false, "md5_digest": "4cf6c6f024bd3d947c56be6b982b0f89", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21816, "upload_time": "2017-08-09T08:04:35", "url": "https://files.pythonhosted.org/packages/b3/3c/f92342ee5bc26a7dbf60d0f62520ea4129b2e44d1336512289fa8c7d2c93/dal_admin_filters-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "5eb33e74b0c6e26bfd038f636420ac64", "sha256": "d08fabb62b15e7666e9c1de755cd3842d88a04d82d4dc2348772bd33dae87a4a" }, "downloads": -1, "filename": "dal_admin_filters-0.2.2-py3.6.egg", "has_sig": false, "md5_digest": "5eb33e74b0c6e26bfd038f636420ac64", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 7725, "upload_time": "2019-02-16T12:13:46", "url": "https://files.pythonhosted.org/packages/9a/39/290d013c257ad38c7bf78789789e3e12e4d6587e8067262901f6f5162951/dal_admin_filters-0.2.2-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "33f4fd961c6b8ab473c1335a52705993", "sha256": "4d7f5ce2ce4321b51875a3775504cea432dac1f4cedeca12eb54a7f844340e63" }, "downloads": -1, "filename": "dal_admin_filters-0.2.2.tar.gz", "has_sig": false, "md5_digest": "33f4fd961c6b8ab473c1335a52705993", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21827, "upload_time": "2017-08-09T09:04:43", "url": "https://files.pythonhosted.org/packages/b2/a7/6281be02377a876806be4d659a06871b2ddf863c09e7856a9807df7b259b/dal_admin_filters-0.2.2.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "4c500dce002c52a5be6dc940acc14dac", "sha256": "f67a12f8570d63450984a3dee66134bdb5473060b3caab85bd046335ae7084ff" }, "downloads": -1, "filename": "dal_admin_filters-0.3.0-py3.6.egg", "has_sig": false, "md5_digest": "4c500dce002c52a5be6dc940acc14dac", "packagetype": "bdist_egg", "python_version": "3.6", "requires_python": null, "size": 7726, "upload_time": "2019-02-16T12:13:47", "url": "https://files.pythonhosted.org/packages/12/bb/4e41b5f6511c9849ae9d110f444bd133b4e8ed694d644d67b7b60d77f273/dal_admin_filters-0.3.0-py3.6.egg" }, { "comment_text": "", "digests": { "md5": "2d3f25ff1fd0cbc3082ea4d95a84bcfb", "sha256": "9dbf2ec22c588e8c0ac5b2575da0efdadf78ac0c71734328368892beadb72fba" }, "downloads": -1, "filename": "dal_admin_filters-0.3.0-py3-none-any.whl", "has_sig": false, "md5_digest": "2d3f25ff1fd0cbc3082ea4d95a84bcfb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6810, "upload_time": "2019-02-16T12:13:44", "url": "https://files.pythonhosted.org/packages/80/d3/88548a72b59780f9469c79dbe495ed1e9f0929300fce2342be65f94b3018/dal_admin_filters-0.3.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bdbb7a4ea2998033d614f1ba86e7c69d", "sha256": "99f733756c8d39d46d6ffd1ce38f623930e6182971eac4439b684bdc1cf14a69" }, "downloads": -1, "filename": "dal_admin_filters-0.3.0.tar.gz", "has_sig": false, "md5_digest": "bdbb7a4ea2998033d614f1ba86e7c69d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5929, "upload_time": "2019-02-16T12:13:48", "url": "https://files.pythonhosted.org/packages/76/c8/9807d4ef6522521a8fba8be8ee006645bf63c56d8ea5f52ca9094cb06c0a/dal_admin_filters-0.3.0.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "483a0fae5d6d32db8686bb815a20fa6d", "sha256": "b80b80e6088f3d047f92fa596e9c6c1d1ec76a6383dff24eb1dfac2dbccecfac" }, "downloads": -1, "filename": "dal_admin_filters-0.3.3-py3-none-any.whl", "has_sig": false, "md5_digest": "483a0fae5d6d32db8686bb815a20fa6d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 30462, "upload_time": "2019-02-16T18:53:23", "url": "https://files.pythonhosted.org/packages/dd/23/84b1cf45e0b5fe10fc551050328d563f143c06059a39794c11cc79e62078/dal_admin_filters-0.3.3-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "483a0fae5d6d32db8686bb815a20fa6d", "sha256": "b80b80e6088f3d047f92fa596e9c6c1d1ec76a6383dff24eb1dfac2dbccecfac" }, "downloads": -1, "filename": "dal_admin_filters-0.3.3-py3-none-any.whl", "has_sig": false, "md5_digest": "483a0fae5d6d32db8686bb815a20fa6d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 30462, "upload_time": "2019-02-16T18:53:23", "url": "https://files.pythonhosted.org/packages/dd/23/84b1cf45e0b5fe10fc551050328d563f143c06059a39794c11cc79e62078/dal_admin_filters-0.3.3-py3-none-any.whl" } ] }