Django Sweet Autocomplete
=====
The purpose of Sweet Autocomplete is to simplify autocomplete
functionalities implementation in your Django project.
Quick start
-----------
1. Add "sweetautocomplete" to your INSTALLED_APPS setting::
```python
INSTALLED_APPS = [
...
'sweetautocomplete',
]
```
2. Include the autocomplete URLconf in your project `urls.py`:
```python
urlpatterns = [
...
path("", include("sweetautocomplete.urls")),
...
]
```
3. Create a file called `autocomplete.py` in your app:
```python
from sweetautocomplete.autocomplete import autocompletefactory, AbstractAutocomplete
from .models import MyModel
class MyModelAutocomplete(AbstractAutocomplete):
model = MyModel
field = "field_name"
class Serializer(serializers.ModelSerializer):
label = serializers.CharField(source="field_name")
class Meta:
model = MyModel
fields = ["label"]
autocompletefactory.register("model_name", MyModelAutocomplete)
```
4. Use autocomplete endpoints in your templates:
```html
"{% url 'autocomplete' 'model_name' %}?query=..."
```
Raw data
{
"_id": null,
"home_page": "https://github.com/kubeljk/django-sweet-autocomplete",
"name": "django-sweet-autocomplete",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "django autocomplete",
"author": "Klemen Kubelj",
"author_email": "klemen.kubelj@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/c2/2c/06d9b940f9f70042e40f27a976b6d5e6bfb4190cfd1f840ffbc129237aaa/django_sweet_autocomplete-1.2.0.tar.gz",
"platform": null,
"description": "Django Sweet Autocomplete\n=====\n\nThe purpose of Sweet Autocomplete is to simplify autocomplete\nfunctionalities implementation in your Django project.\n\nQuick start\n-----------\n\n1. Add \"sweetautocomplete\" to your INSTALLED_APPS setting::\n```python\nINSTALLED_APPS = [\n ...\n 'sweetautocomplete',\n]\n```\n\n2. Include the autocomplete URLconf in your project `urls.py`:\n```python\nurlpatterns = [\n ...\n path(\"\", include(\"sweetautocomplete.urls\")),\n ...\n]\n\n```\n\n3. Create a file called `autocomplete.py` in your app:\n```python\nfrom sweetautocomplete.autocomplete import autocompletefactory, AbstractAutocomplete\nfrom .models import MyModel\n\nclass MyModelAutocomplete(AbstractAutocomplete):\n model = MyModel\n field = \"field_name\"\n\n class Serializer(serializers.ModelSerializer):\n label = serializers.CharField(source=\"field_name\")\n\n class Meta:\n model = MyModel\n fields = [\"label\"]\n\n\nautocompletefactory.register(\"model_name\", MyModelAutocomplete)\n```\n\n4. Use autocomplete endpoints in your templates:\n```html\n\"{% url 'autocomplete' 'model_name' %}?query=...\"\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Simplify autocomplete functionalities implementation in your Django project.",
"version": "1.2.0",
"project_urls": {
"Homepage": "https://github.com/kubeljk/django-sweet-autocomplete"
},
"split_keywords": [
"django",
"autocomplete"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "e975a13f0f175a892b24246dc6c10f55c7bd837c5c09392a8d55b43ea91b2362",
"md5": "0aa9f746bcd9767fa5a129b8b8b5a992",
"sha256": "a2e39a42a9b02f919f3828798c010a1f85ab9a37e634397c2717cb981bcf9ebf"
},
"downloads": -1,
"filename": "django_sweet_autocomplete-1.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0aa9f746bcd9767fa5a129b8b8b5a992",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 4467,
"upload_time": "2024-11-15T09:43:29",
"upload_time_iso_8601": "2024-11-15T09:43:29.903111Z",
"url": "https://files.pythonhosted.org/packages/e9/75/a13f0f175a892b24246dc6c10f55c7bd837c5c09392a8d55b43ea91b2362/django_sweet_autocomplete-1.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c22c06d9b940f9f70042e40f27a976b6d5e6bfb4190cfd1f840ffbc129237aaa",
"md5": "19ec7a0e0563345a2e21612a43cb6a16",
"sha256": "77db05eb53a08aa1c90c733dd9f7e79b6518e6e8d43b884275d5f60e3e2f976e"
},
"downloads": -1,
"filename": "django_sweet_autocomplete-1.2.0.tar.gz",
"has_sig": false,
"md5_digest": "19ec7a0e0563345a2e21612a43cb6a16",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 3316,
"upload_time": "2024-11-15T09:43:30",
"upload_time_iso_8601": "2024-11-15T09:43:30.949351Z",
"url": "https://files.pythonhosted.org/packages/c2/2c/06d9b940f9f70042e40f27a976b6d5e6bfb4190cfd1f840ffbc129237aaa/django_sweet_autocomplete-1.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-15 09:43:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kubeljk",
"github_project": "django-sweet-autocomplete",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"requirements": [
{
"name": "Django",
"specs": [
[
"<",
"5"
],
[
">=",
"3.2"
]
]
},
{
"name": "djangorestframework",
"specs": [
[
">=",
"3"
]
]
},
{
"name": "psycopg2-binary",
"specs": [
[
">=",
"2.8"
]
]
}
],
"lcname": "django-sweet-autocomplete"
}