{ "info": { "author": "Matthew Schinckel", "author_email": "matt@schinckel.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "=====================\ndjango-filtered-form\n=====================\n\n\n---------------\nInstallation\n---------------\n\nIn your virtualenv, use ``pip install django-filteredform``.\n\nYou don't need to install it into your ``settings.INSTALLED_APPS``, as it \ndoes not provide any models or templates, only forms.\n\n---------------\nUsage\n---------------\n\nDeclarative way to define filters on fields on a django model form::\n\n from django import forms\n from people.models import Person\n from filtered_form.forms import FilteringForm\n \n class PersonAdminForm(FilteringForm):\n class Meta:\n model = Person\n \n instance_filters = {\n 'units': 'company.units'\n }\n filters = {\n 'units': models.Q(is_active=True),\n 'colours__in': ['red','blue','green']\n }\n\n~~~~~~~~~~~~~~~~~~~~~\n``instance_filters``\n~~~~~~~~~~~~~~~~~~~~~\n``instance_filters`` are things that allow for relational filters to be applied.\n\nFor instance, if you have a triple of models, ``Person``, ``Unit`` and ``Company``, \nand every person and unit have a foreign key to a company, you can\nuse an instance filter to easily select only the associated company's units for\na queryset when viewing a person.\n\nAlternatively, you can supply a queryset method (that does not require arguments),\nfor more filtering::\n\n instance_filters = {\n 'units': 'company.units.active'\n }\n\n~~~~~~~~~~~~~~~~~~~~~\nplain ``filters``\n~~~~~~~~~~~~~~~~~~~~~\n\nA more conventional filter structure, that allows you to supply a ``Q`` object, or\na dict of key-value pairs, which will be passed to ``.filter()`` on the queryset.\n\nYou can quite easily shoot yourself in the foot if your filter keys are not valid\narguments for a filter function on that queryset.\n\n~~~~~~~~~~~~~~~~~~~~~\nFormSets\n~~~~~~~~~~~~~~~~~~~~~\n\nYou can either create a form using this method, and then pass that to your formset\nclass or factory. Or, you can have a formset class based on ``filtered_form.forms.FilteredFormSet``,\nwhich will also set up the queryset values on the empty form correctly, which is very\nuseful if you are using dynamic forms.\n\n---------------\nVersion History\n---------------\n\n~~~~~~~~\n1.0.3\n~~~~~~~~\nFix a bug where new objects could not be created in the django admin.\n\n~~~~~~~~\n1.0.1\n~~~~~~~~\nImprove documentation.\n\nAllow for a callable in the value of an ``instance_filter``.\n\nAllow for a dict in the value of a ``filter``.\n\n~~~~~~~~\n1.0\n~~~~~~~~\nInitial Release.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://bitbucket.org/schinckel/django-filtered-form", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "django-filtered-form", "package_url": "https://pypi.org/project/django-filtered-form/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-filtered-form/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://bitbucket.org/schinckel/django-filtered-form" }, "release_url": "https://pypi.org/project/django-filtered-form/1.0.3/", "requires_dist": null, "requires_python": null, "summary": "A Form that can have per-field queryset filters declaratively defined", "version": "1.0.3" }, "last_serial": 789651, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "96893781a5f8afb8fa4185431f2ce04b", "sha256": "fa3f1e28fb77c337cfb0de2345de7bce3bdea04604ca2239fac2ac90c4ce5ee0" }, "downloads": -1, "filename": "django-filtered-form-1.0.1.tar.gz", "has_sig": false, "md5_digest": "96893781a5f8afb8fa4185431f2ce04b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3005, "upload_time": "2012-08-09T08:30:20", "url": "https://files.pythonhosted.org/packages/3f/e0/db371e0108463a4fc82dec119a6bd1e14232148775b6fb139286b07c9217/django-filtered-form-1.0.1.tar.gz" } ], "1.0.1\n": [], "1.0.2": [ { "comment_text": "", "digests": { "md5": "ed3313d82738aec5c941f0af2f136eec", "sha256": "85bcda13abb96b0308017c71c4a25ba919e5dafc4befe12d8e91fd6db4612e4b" }, "downloads": -1, "filename": "django-filtered-form-1.0.2.tar.gz", "has_sig": false, "md5_digest": "ed3313d82738aec5c941f0af2f136eec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3040, "upload_time": "2012-08-21T02:57:11", "url": "https://files.pythonhosted.org/packages/1e/93/bae7d7dcc65306a2c9f5cce77f1d0ddfa59a393d7332ba16f53f5e4b1c33/django-filtered-form-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "ad1293e4f8db6742ae6ae7a2e3f6fc2a", "sha256": "df65ae53336445fb9a0176e795b8570052d8aa8ac7c0b16d41a7e6dc31d75568" }, "downloads": -1, "filename": "django-filtered-form-1.0.3.tar.gz", "has_sig": false, "md5_digest": "ad1293e4f8db6742ae6ae7a2e3f6fc2a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3091, "upload_time": "2012-09-06T05:46:22", "url": "https://files.pythonhosted.org/packages/b6/18/464a98053b29365b1fb685dc14dd47cfefbf9febd1f598ae083a4f8b52db/django-filtered-form-1.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ad1293e4f8db6742ae6ae7a2e3f6fc2a", "sha256": "df65ae53336445fb9a0176e795b8570052d8aa8ac7c0b16d41a7e6dc31d75568" }, "downloads": -1, "filename": "django-filtered-form-1.0.3.tar.gz", "has_sig": false, "md5_digest": "ad1293e4f8db6742ae6ae7a2e3f6fc2a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3091, "upload_time": "2012-09-06T05:46:22", "url": "https://files.pythonhosted.org/packages/b6/18/464a98053b29365b1fb685dc14dd47cfefbf9febd1f598ae083a4f8b52db/django-filtered-form-1.0.3.tar.gz" } ] }