Simplify autocomplete functionalities implementation in your Django project.
Project description
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.py
in 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=..."
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-sweet-autocomplete-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6479a0af57f04db61608b6ad633de5e5978cb9f5cd2c0c966040d17ca3aeedc7 |
|
MD5 | c9d8827afabba5cd07abea83758cc62c |
|
BLAKE2b-256 | 75f03d3403621d4c5953be029d06da0c308a9fc3797efec8cb4aabe4911e7131 |
Close
Hashes for django_sweet_autocomplete-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea26398d1ce4ca3cbbcaff7318beb681103d243871152eeebf450adfe4bd8d27 |
|
MD5 | e7731ab1ef0f746754dc1ed6473ef3f6 |
|
BLAKE2b-256 | 4922521405c72a27a962a1d3237b79a2da7b333cbfda58c2f8bef4a87c343cc5 |