Django Sweet Autocomplete
The purpose of Sweet Autocomplete is to simplify autocomplete functionalities implementation in your Django project.
Quick start
- Add "sweetautocomplete" to your INSTALLED_APPS setting::
INSTALLED_APPS = [
...
'sweetautocomplete',
]
- Include the autocomplete URLconf in your project
urls.py:
urlpatterns = [
...
path("", include("sweetautocomplete.urls")),
...
]
- Create a file called
autocomplete.pyin your app:
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)
- Use autocomplete endpoints in your templates:
"{% url 'autocomplete' 'model_name' %}?query=..."
Metadata
Release files for django-sweet-autocomplete 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django_sweet_autocomplete-1.2.0.tar.gz | 3.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_sweet_autocomplete-1.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.8 kB
Release files / django_sweet_autocomplete-1.2.0.tar.gz
| Download URL | django_sweet_autocomplete-1.2.0.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
77db05eb53a08aa1c90c733dd9f7e79b6518e6e8d43b884275d5f60e3e2f976e
|
|
BLAKE2b-256 checksum How to use checksums |
c22c06d9b940f9f70042e40f27a976b6d5e6bfb4190cfd1f840ffbc129237aaa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Release files / django_sweet_autocomplete-1.2.0-py3-none-any.whl
| Download URL | django_sweet_autocomplete-1.2.0-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a2e39a42a9b02f919f3828798c010a1f85ab9a37e634397c2717cb981bcf9ebf
|
|
BLAKE2b-256 checksum How to use checksums |
e975a13f0f175a892b24246dc6c10f55c7bd837c5c09392a8d55b43ea91b2362
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|