Skip to main content

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::
INSTALLED_APPS = [
    ...
    'sweetautocomplete',
]
  1. Include the autocomplete URLconf in your project urls.py:
urlpatterns = [
    ...
    path("", include("sweetautocomplete.urls")),
    ...
]
  1. 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)
  1. 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)

Source distribution for django-sweet-autocomplete 1.2.0
File Size Uploaded
django_sweet_autocomplete-1.2.0.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-sweet-autocomplete 1.2.0
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 release files

1.1.0

2 release files

1.0.2

1 release file

1.0.1

2 release files

0.0.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page