{ "info": { "author": "Rune Kaagaard", "author_email": "rumi.kg@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "## About ##\nThis Django app makes it easier to create custom filters in the change list of\nDjango Admin and supplies a `TreeFilter` and a `DateRangeFilter` too. Se below.\n\nTested on Django 1.2.3 and from @15ea9a9 1.3.1.\n\n## Updating to 1.3 support ##\nI will write proper docs, things are getting messy here, but here is the\nlowdown.\n\n### New settings required ###\nAs I found out, you can't reliably convert the django date formats to\nDatepicker formats. So this commit introduces these two new settings:\n\n FILTRATE = {\n\t\t# See http://jqueryui.com/demos/datepicker/#localization.\n\t\t'datepicker_region': 'en-GB',\n\t\t# See http://docs.jquery.com/UI/Datepicker/formatDate.\n\t\t'datepicker_date_format': 'yy-mm-dd',\n\t}\n\nSo if the above defaults does not suit you, you have to change them your self. \nCheck out the Datepicker documentation to see how to use them.\n\n### lookup_allowed() ###\nDjango 1.2.4 introduces restrictions on which lookups that can be queried\nin the url, so at the moment the end user are responsible for\nchecking for those, as in this example:\n\n class CaseAdmin(admin.ModelAdmin):\n\t\tlist_filter = ['client']\n\t\n\t\tdef lookup_allowed(self, key, *args, **kwargs):\n\t\t\tif 'client__start_date' in key:\n\t\t\t\treturn True\n\t\t\telse:\n\t\t\t\treturn super(CaseAdmin, self).lookup_allowed(key, *args, **kwargs)\n\n### Undefined Media() class bug ###\nTime and my Python meta-fu is running out, and I couldn't fix it\nso its not neccessary to define an empty Media() class as in:\n\n class CaseAdmin(admin.ModelAdmin):\n\t\tclass Media():\n\t\t\tpass\n\t\t\t\n## The FiltrateFilter ##\nThe base class that adds support for custom html in the content of the filter\nand for using `Media()` classes.\n\n## TreeFilter ##\nA recursive tree filter using the excellent library http://www.jstree.com/. \n\n### Example ###\n```python\n# The Filter.\nfrom filtrate.filters import TreeFilter\nfrom itertools import groupby\nclass CompanyDepartmentFilter(TreeFilter):\n field_name = \"client__department__id__in\"\n \n def get_title(self):\n return 'By Department'\n \n def get_tree(self):\n from company.models import Department\n qs = Department.objects.all().order_by('company_order', 'company')\n return groupby(qs, lambda obj: getattr(obj, 'company'))\n\n# The model.\nfrom filtrate import register_filter\nclass Case(Model):\n ...\n register_filter(field_name, CompanyDepartmentFilter)\n\t...\n```\n\n## DateRangeFilter ##\nFilters results in a given date range using the jQueryUI datepicker plugin.\n\n### Example ###\n```python\n# The Filter.\nfrom filtrate.filters import DateRangeFilter\n\nclass CaseLicenseStartDateFilter(DateRangeFilter):\n field_name = 'caselicense__start_date'\n \n def get_title(self):\n return \"By license start date\"\n\n# The model.\nfrom filtrate import register_filter\nclass Case(Model):\n ...\n register_filter(field_name, CaseLicenseStartDateFilter)\n\t...\n```\n\n## Installation ##\n\n* Clone the repo and symlink or copy the \"filtrate\" folder to your apps folder.\n* Add `filtrate` to your installed apps.\n* Add the \"filtrate/templates\" folder to your template folders.\n\n### Static files ###\n\nFlexSelect requires \"django.contrib.staticfiles\" installed to work out of the \nbox. If it is not then the js and css files must be installed manually. \nRead more about \"django.contrib.staticfiles\" at \nhttps://docs.djangoproject.com/en/1.3/ref/contrib/staticfiles/.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/runekaagaard/django-admin-filtrate", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "django-admin-filtrate", "package_url": "https://pypi.org/project/django-admin-filtrate/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-admin-filtrate/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/runekaagaard/django-admin-filtrate" }, "release_url": "https://pypi.org/project/django-admin-filtrate/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "This Django app makes it easier to create custom filters in the change list of Django Admin and supplies a TreeFilter and a DateRangeFilter too.", "version": "0.1.0" }, "last_serial": 789046, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "46c1ad134c29fb49796aac865cb332b9", "sha256": "22ad751771c2877dc1a57fd01d56ee108a8ec88f21ed0369153669b02dfe3b48" }, "downloads": -1, "filename": "django-admin-filtrate-0.1.0.tar.gz", "has_sig": false, "md5_digest": "46c1ad134c29fb49796aac865cb332b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 220857, "upload_time": "2011-11-23T15:40:05", "url": "https://files.pythonhosted.org/packages/52/77/5872864be981e27e9879e5ed670c898f4b6a5a7c31174a4e893def15dbb2/django-admin-filtrate-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "46c1ad134c29fb49796aac865cb332b9", "sha256": "22ad751771c2877dc1a57fd01d56ee108a8ec88f21ed0369153669b02dfe3b48" }, "downloads": -1, "filename": "django-admin-filtrate-0.1.0.tar.gz", "has_sig": false, "md5_digest": "46c1ad134c29fb49796aac865cb332b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 220857, "upload_time": "2011-11-23T15:40:05", "url": "https://files.pythonhosted.org/packages/52/77/5872864be981e27e9879e5ed670c898f4b6a5a7c31174a4e893def15dbb2/django-admin-filtrate-0.1.0.tar.gz" } ] }