{ "info": { "author": "Lorenzo Gil Sanchez", "author_email": "lgs@yaco.es", "bugtrack_url": null, "classifiers": [], "description": ".. contents::\n\n===========\nSearch Form\n===========\n\nSearch Form is a Django application that lets you create very fancy search\nforms in your project. Some of its main features are:\n\n * Easy to use: add, edit and remove search terms with very few clicks and\n keystrokes\n * Easy to integrate: just subclass Search Form and add your search terms\n * Easy to customize: you can change the default search terms, or change\n their layouts with custom templates or maybe change the style using CSS\n * Accesible: it works with no javascript degrading gracefully to a nighties\n version\n\nSearch Form is distributed under the terms of the `GNU Lesser General Public\nLicense `_.\n\nDocumentation\n=============\n\nInstallation\n------------\n\nSearch Form depends on jQuery 1.2.X so you need to download it and put\nin your media directory. After that you can install search form. Just type::\n\n easy_install searchform\n\nand Easy Install will go to the Cheeseshop and grab the last searchform for\nyou. It will also install it for you in your site-packages directory at no\nextra cost :-)\n\nTutorial\n--------\n\nUsing search form is quite simple. Just follow these simple steps:\n\n #. Add 'searchform' to your INSTALLED_APPS tuple in your settings.py. This\n is neccesary so Django can find the default searchform templates.\n #. Add the following url to your urls.py before your regular media url::\n\n (r'^media/searchform/', include('searchform.urls'))\n\nNow, suppose you have this simple model in your application::\n\n class Animal(models.Model):\n name = models.CharField(max_length=100)\n weight = models.CharField(max_length=100)\n max_speed = models.IntegerField()\n\nAnd you want to make a search form that lets your users find animals in your\nwild database::\n\n from django.utils.datastructures import SortedDict\n\n from searchform.forms import SearchForm\n from searchform.terms import TextSearchTerm\n\n class AnimalSearchForm(SearchForm):\n fields = SortedDict((\n ('name': TextSearchForm('The name', 'Name', 'which name')),\n ('weight': TextSearchForm('The weight', 'Weight', 'which weight')),\n ('max_speed': TextSearchForm('The max speed', 'Speed', \n 'which max speed')),\n ))\n\nBelieve it or not that's all the python code you need to write to set up your\nsearch form. Now it's time to use it in your views::\n\n def advanced_search(request):\n form = AnimalSearchForm('Find animals!', None)\n return render_to_response('your_template.html', {'form': form})\n\n\nFinally let's see how your template looks like::\n\n {% extends \"base.html\" %}\n\n {% block extrahead %}\n \n {{ form.render_media|safe }}\n {% endblock %}\n\n {% block content %}\n
\n\n
\n {{ form }}\n
\n\n
\n {% endblock %}\n\nTwo things worth noting here:\n\n * You need to include jQuery **before** the media of the form\n * The search form must have the id 'search_form'\n\n\nTODO: explain how to customize the templates and how to write custom search\nterms. Explain what the QueryStringManager is\n\nDevelopment\n===========\n\nYou can get the last bleeding edge version of searchform by doing a checkout\nof its subversion repository::\n\n svn co https//svnpub.yaco.es/djangoapps/searchform/trunk searchform\n\nBug reports, patches and suggestions are more than welcome. Just put them\nin our Trac system::\n\n https://tracpub.yaco.es/djangoapps/SearchForm\n\n\n\nChanges\n=======\n\n0.1.1 (2010-12-22)\n------------------\n- Fix a packaging issue: media files weren't being installed\n\n0.1.0 (2008-12-16)\n------------------\n- Initial release", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://tracpub.yaco.es/djangoapps/wiki/SearchForm", "keywords": "search django", "license": "LGPL 3", "maintainer": null, "maintainer_email": null, "name": "searchform", "package_url": "https://pypi.org/project/searchform/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/searchform/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://tracpub.yaco.es/djangoapps/wiki/SearchForm" }, "release_url": "https://pypi.org/project/searchform/0.1.1/", "requires_dist": null, "requires_python": null, "summary": "An advanced search form application for Django", "version": "0.1.1" }, "last_serial": 726807, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "604bff16e75d8ac23d0b7c7bd7aeb411", "sha256": "ba15a39cad96362039ed4a8b419f7842b1fa9c7c4013b3932e1007fd648eb52e" }, "downloads": -1, "filename": "searchform-0.1.0.tar.gz", "has_sig": false, "md5_digest": "604bff16e75d8ac23d0b7c7bd7aeb411", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17148, "upload_time": "2008-12-16T19:38:19", "url": "https://files.pythonhosted.org/packages/92/2b/ec1a398a3283849950bf6f580c72bb3404b3cbf2eda9af33e3bdce411809/searchform-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "7032fd6d5f699c9a488b47a0da554de3", "sha256": "b2f1fe9e736fcb2e217dd58c19a1b8976d8e348667aa7bef55b3267efe72a3c3" }, "downloads": -1, "filename": "searchform-0.1.1.tar.gz", "has_sig": false, "md5_digest": "7032fd6d5f699c9a488b47a0da554de3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24267, "upload_time": "2010-12-22T20:48:10", "url": "https://files.pythonhosted.org/packages/33/7a/328e4fb3f1cb2b4876e6391ff2060bf98c57c293c58e390e1f1e660a38a9/searchform-0.1.1.tar.gz" } ], "0.1.3dev": [ { "comment_text": "", "digests": { "md5": "9dd1469bf61b43559a5643c83dce4188", "sha256": "ec7e71641bc937b81bf909556d9b8c273f8f68c2a998b59142eda8dd0d4538e1" }, "downloads": -1, "filename": "searchform-0.1.3dev.tar.gz", "has_sig": false, "md5_digest": "9dd1469bf61b43559a5643c83dce4188", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24180, "upload_time": "2011-07-21T14:12:40", "url": "https://files.pythonhosted.org/packages/31/9c/8499a7feec0ae06d2636c36b64c3ab4373f813ae0dff1c92c699a4f0f9f9/searchform-0.1.3dev.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7032fd6d5f699c9a488b47a0da554de3", "sha256": "b2f1fe9e736fcb2e217dd58c19a1b8976d8e348667aa7bef55b3267efe72a3c3" }, "downloads": -1, "filename": "searchform-0.1.1.tar.gz", "has_sig": false, "md5_digest": "7032fd6d5f699c9a488b47a0da554de3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24267, "upload_time": "2010-12-22T20:48:10", "url": "https://files.pythonhosted.org/packages/33/7a/328e4fb3f1cb2b4876e6391ff2060bf98c57c293c58e390e1f1e660a38a9/searchform-0.1.1.tar.gz" } ] }