{"id":15359771,"url":"https://github.com/redhog/django-autocomplete","last_synced_at":"2026-05-18T02:03:48.694Z","repository":{"id":8359767,"uuid":"9923961","full_name":"redhog/django-autocomplete","owner":"redhog","description":"Github mirror of django-autocomplete","archived":false,"fork":false,"pushed_at":"2013-10-09T14:29:52.000Z","size":143,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-03T13:48:20.559Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://code.google.com/p/django-autocomplete/","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/redhog.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-07T23:27:50.000Z","updated_at":"2017-03-01T14:39:03.000Z","dependencies_parsed_at":"2022-07-30T23:48:01.249Z","dependency_job_id":null,"html_url":"https://github.com/redhog/django-autocomplete","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/redhog/django-autocomplete","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhog%2Fdjango-autocomplete","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhog%2Fdjango-autocomplete/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhog%2Fdjango-autocomplete/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhog%2Fdjango-autocomplete/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redhog","download_url":"https://codeload.github.com/redhog/django-autocomplete/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redhog%2Fdjango-autocomplete/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33162446,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"online","status_checked_at":"2026-05-18T02:00:06.436Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T12:46:15.504Z","updated_at":"2026-05-18T02:03:48.656Z","avatar_url":"https://github.com/redhog.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhog%2Fdjango-autocomplete","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredhog%2Fdjango-autocomplete","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredhog%2Fdjango-autocomplete/lists"}