{"id":24326004,"url":"https://github.com/omenapps/django-tomselect","last_synced_at":"2026-03-15T04:54:33.372Z","repository":{"id":178178592,"uuid":"661181795","full_name":"OmenApps/django-tomselect","owner":"OmenApps","description":"Autocomplete widgets and views using TomSelect","archived":false,"fork":false,"pushed_at":"2025-03-27T21:39:24.000Z","size":5835,"stargazers_count":67,"open_issues_count":3,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-27T22:31:14.545Z","etag":null,"topics":["autocomplete","django","forms","select","tomselect","views"],"latest_commit_sha":null,"homepage":"https://django-tomselect.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"Actionb/mizdb-tomselect","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OmenApps.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-02T03:43:02.000Z","updated_at":"2025-03-27T21:39:28.000Z","dependencies_parsed_at":"2023-10-13T12:08:38.617Z","dependency_job_id":"734ce01e-dafd-48ec-a090-85e881a87360","html_url":"https://github.com/OmenApps/django-tomselect","commit_stats":null,"previous_names":["jacklinke/django-tomselect"],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OmenApps%2Fdjango-tomselect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OmenApps%2Fdjango-tomselect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OmenApps%2Fdjango-tomselect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OmenApps%2Fdjango-tomselect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OmenApps","download_url":"https://codeload.github.com/OmenApps/django-tomselect/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247353729,"owners_count":20925329,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["autocomplete","django","forms","select","tomselect","views"],"created_at":"2025-01-17T20:29:58.342Z","updated_at":"2026-03-15T04:54:33.366Z","avatar_url":"https://github.com/OmenApps.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n# Django TomSelect\n\n[![PyPI](https://img.shields.io/pypi/v/django-tomselect)](https://pypi.org/project/django-tomselect/)\n[![Python versions](https://img.shields.io/pypi/pyversions/django-tomselect)](https://pypi.org/project/django-tomselect/)\n[![Django versions](https://img.shields.io/pypi/djversions/django-tomselect)](https://pypi.org/project/django-tomselect/)\n[![Documentation](https://readthedocs.org/projects/django-tomselect/badge/?version=latest)](https://django-tomselect.readthedocs.io/en/latest/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\nA powerful, lightweight Django package for dynamic select inputs with autocomplete, tagging, and more.\n\nDjango TomSelect integrates [Tom Select](https://tom-select.js.org/) into your Django projects, providing beautiful and intuitive select inputs with features like:\n\n- **Live Search \u0026 Autocomplete**\n    - Real-time filtering and highlighting as you type\n    - Server-side search with customizable lookups\n    - Automatic pagination for large datasets\n\t- Customizable minimum query length\n\n- **Rich UI Options**\n    - Single and multiple selection modes\n    - Tabular display with custom columns\n    - Bootstrap 4/5 theming support\n\t- Clear/remove buttons\n\t- Dropdown headers \u0026 footers\n\t- Checkbox options\n    - Customizable templates\n\n![Tom Select With Single Select](https://raw.githubusercontent.com/jacklinke/django-tomselect/main/docs/images/Single.png)\n![Tom Select Tabular With Multiple Select](https://raw.githubusercontent.com/jacklinke/django-tomselect/main/docs/images/Multiple_Tabular.png)\n\n## Quick Start\n\n1. **Install the package:**\n```bash\npip install django-tomselect\n```\n\n2. **Update settings.py:**\n```python\nINSTALLED_APPS = [\n    ...\n    \"django_tomselect\"\n]\n\nMIDDLEWARE = [\n    ...\n    \"django_tomselect.middleware.TomSelectMiddleware\",\n    ...\n]\n\nTEMPLATES = [\n    {\n        \"OPTIONS\": {\n            \"context_processors\": [\n                ...\n                \"django_tomselect.context_processors.tomselect\",\n                ...\n            ],\n        },\n    },\n]\n```\n\n3. **Create an autocomplete view:**\n```python\nfrom django_tomselect.autocompletes import AutocompleteModelView\n\nclass PersonAutocompleteView(AutocompleteModelView):\n    model = Person\n    search_lookups = [\"full_name__icontains\"]\n    value_fields = [\"id\",\"full_name\"]\n```\n\n4. **Add URL pattern:**\n```python\nurlpatterns = [\n    path(\"person-autocomplete/\", PersonAutocompleteView.as_view(), name=\"person_autocomplete\"),\n]\n```\n\n5. **Use in your forms:**\n```python\nfrom django_tomselect.forms import TomSelectModelChoiceField, TomSelectConfig\n\nclass MyForm(forms.Form):\n    person = TomSelectModelChoiceField(\n        config = TomSelectConfig(\n            url=\"person_autocomplete\",\n            value_field=\"id\",\n            label_field=\"full_name\",\n        )\n    )\n```\n\n6. **Include in your template:**\n```html\n{{ form.media }}  {# Adds the required CSS/JS #}\n\n{{ form }}\n```\n\n## Other Features\n\n### Advanced Filtering\n- Dependent/chained select fields\n- Field exclusion support\n- Custom search implementations\n- Hooks for overriding functionality\n\n### Flexible Configuration\n- Support for [Tom Select Plugins](https://tom-select.js.org/plugins/)\n- Global settings and per-form-field configuration\n- Override any template\n\n### Security\n- Built-in permission handling\n\t- including django auth, custom auth, object perms\n\n### Internationalization\n- Translation support\n- Customizable messages\n\n## Example Project\n\nTo see Django TomSelect in action, check out the [Example Project](https://github.com/OmenApps/django-tomselect/tree/main/example_project). It demonstrates a variety of use cases, with **15 different implementations** from basic atocompletion to advanced applications, showing how to use django-tomselect's autocomplete fields in a Django project.\n\nEach of the examples is described in [the Example Project docs](https://django-tomselect.readthedocs.io/en/latest/example_app/introduction.html).\n\nHere are a few screenshots from the example project:\n\n![Rich Content Article Selection](https://raw.githubusercontent.com/jacklinke/django-tomselect/main/docs/images/rich-article-select1.png)\n\n---\n\n![Article List](https://raw.githubusercontent.com/jacklinke/django-tomselect/main/docs/images/article-list.png)\n\n---\n\n![Article Bulk Actions](https://raw.githubusercontent.com/jacklinke/django-tomselect/main/docs/images/article-bulk-action2.png)\n\n## Documentation\n\n- [Complete Usage Guide](https://django-tomselect.readthedocs.io/en/latest/usage.html)\n- [Configuration Reference](https://django-tomselect.readthedocs.io/en/latest/api/config.html)\n- [Example Project](https://django-tomselect.readthedocs.io/en/latest/example_app/introduction.html)\n\n## Contributing\n\nContributions are welcome! Check out our [Contributor Guide](https://github.com/OmenApps/django-tomselect/blob/main/CONTRIBUTING.md) to get started.\n\n## License\n\nThis project is licensed under the MIT License - see the [License](https://github.com/OmenApps/django-tomselect/blob/main/LICENSE) file for details.\n\n## Acknowledgments\n\nThis package builds on the excellent work of [Philip Becker](https://pypi.org/user/actionb/) in [mizdb-tomselect](https://www.pypi.org/project/mizdb-tomselect/), with a focus on generalization, Django templates, translations, and customization.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomenapps%2Fdjango-tomselect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fomenapps%2Fdjango-tomselect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fomenapps%2Fdjango-tomselect/lists"}