{ "info": { "author": "nikolovski.darko@gmail.com", "author_email": "nikolovski.darko@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# AutoComplete for ForeignKey and ManyToManyField\nuses same syntax as the search for django-admin\n\nrequirements\n * query.js (http://jquery.com/)\n * query.autocomplete.js\n\n## Example\n\n\nuse a fairly simple\n*models.py*\n class Type (models.Model):\n title = models.CharField()\n \n class Celebrity(models.Model):\n name = models.CharField()\n\n class Film(models.Model):\n type = models.ForeignKey( Type )\n director= models.ManyToManyField( Celebrity, related_name=\"director\")\n actor = models.ManyToManyField( Celebrity, related_name=\"actor\")\n\nin m2m field need to specify related_name\n\n*admin.py*\n from apps.autocomplete.widgets import *\n \n class FilmAdmin(AutocompleteModelAdmin):\n related_search_fields = { \n\n 'type': ('title',),\n 'actor': ('^name',),\n 'director': ('^name',),\n }\n admin.site.register( Film, FilmAdmin )\n\n\"related_search_fields\" parameter is used to specify on what fields you want to search 'actor' and 'director' ties are the names given in \"related_name\" query syntax is similar to [searching in admin panel](http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.ModelAdmin.search_fields)\n\nI use the \" 'actor': ('^name',) \" operator ^ means the beginning of the field. and eventually will be formed about the substitution request form For example, if related_search_fieldsis set to ('^name',') and a user searches for john lennon, Django will do the equivalent of this SQL WHERE clause:\n\nWHERE name ILIKE 'john%' AND name ILIKE 'lennon%'\n\n", "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/redhog/django-autocomplete", "keywords": "django autocomplete foreignkey", "license": "GPL", "maintainer": null, "maintainer_email": null, "name": "django_autocomplete_foreignkey", "package_url": "https://pypi.org/project/django_autocomplete_foreignkey/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django_autocomplete_foreignkey/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/redhog/django-autocomplete" }, "release_url": "https://pypi.org/project/django_autocomplete_foreignkey/0.0.1/", "requires_dist": null, "requires_python": null, "summary": "AutoComplete for ForeignKey and ManyToManyField.", "version": "0.0.1" }, "last_serial": 885154, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "a6002c71a5e50983ae642ac955c25bd9", "sha256": "73b040e8fab18653aa04796a4ca6d433f7e41d6040a748713155ae6bf9f8fe97" }, "downloads": -1, "filename": "django_autocomplete_foreignkey-0.0.1.tar.gz", "has_sig": false, "md5_digest": "a6002c71a5e50983ae642ac955c25bd9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11682, "upload_time": "2013-10-09T14:29:59", "url": "https://files.pythonhosted.org/packages/62/a7/250022fa3bb9ba70a19fb9131ee1afda56d2f969dc9293a529baa4c19d66/django_autocomplete_foreignkey-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a6002c71a5e50983ae642ac955c25bd9", "sha256": "73b040e8fab18653aa04796a4ca6d433f7e41d6040a748713155ae6bf9f8fe97" }, "downloads": -1, "filename": "django_autocomplete_foreignkey-0.0.1.tar.gz", "has_sig": false, "md5_digest": "a6002c71a5e50983ae642ac955c25bd9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11682, "upload_time": "2013-10-09T14:29:59", "url": "https://files.pythonhosted.org/packages/62/a7/250022fa3bb9ba70a19fb9131ee1afda56d2f969dc9293a529baa4c19d66/django_autocomplete_foreignkey-0.0.1.tar.gz" } ] }