Skip to main content

Autocompletion for django-tagging

Project description

django-tagging-autocomplete is a jquery based autocomplete solution for django-tagging.

Requirements

  • django-tagging

Setup

  1. Download package and install, for example using pip:

    pip install django-tagging-autocomplete
  2. Add tagging_autocomplete to installed apps in your project’s settings.

  3. Add the following line to your project’s urls.py file:

    (r'^tagging_autocomplete/', include('tagging_autocomplete.urls')),

Usage

The Model Field

You can use TagAutocompleteField() to enable autocompletion right in your models.py. In most cases this is the easiest solution:

from django.db import models
from tagging_autocomplete.models import TagAutocompleteField

class SomeModel(models.Model):
        tags = TagAutocompleteField()

The Form Widget

Alternatively you can use the TagAutocomplete() form widget while creating your form:

from django import forms
from tagging.forms import TagField
from tagging_autocomplete.widgets import TagAutocomplete

class SomeForm(forms.Form):
    tags = TagField(widget=TagAutocomplete())

Optional settings

By default the maximum number of results suggested by the autocompletion is 100. You can modify this number by adding to your settings.py project file the TAGGING_AUTOCOMPLETE_MAX_RESULTS constant. For example:

TAGGING_AUTOCOMPLETE_MAX_RESULTS = 5

By default autocompletion suggests tags that start with a given term. In case you need to show ones that contain the given term, set TAGGING_AUTOCOMPLETE_SEARCH_CONTAINS to True. For example:

TAGGING_AUTOCOMPLETE_SEARCH_CONTAINS = True

By default suggestions are shown right after you enter first character. You can configure this behaviour using TAGGING_AUTOCOMPLETE_MIN_LENGTH. For example:

TAGGING_AUTOCOMPLETE_MIN_LENGTH = 3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-tagging-autocomplete-0.5.1.tar.gz (53.7 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file django-tagging-autocomplete-0.5.1.tar.gz.

File metadata

  • Download URL: django-tagging-autocomplete-0.5.1.tar.gz
  • Upload date:
  • Size: 53.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for django-tagging-autocomplete-0.5.1.tar.gz
Algorithm Hash digest
SHA256 5e1bccc0c24504fdd3bf764feb165a0ddf527a2377bec314ac0c310be0833188
MD5 1a9581acf8af4717e28b67dc2695bd3b
BLAKE2b-256 54838a8b307ad517f51a231844dfd8a6101e00ac094fda91ffa42b45386121ef

See more details on using hashes here.

Provenance

File details

Details for the file django_tagging_autocomplete-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: django_tagging_autocomplete-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 78.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.7

File hashes

Hashes for django_tagging_autocomplete-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 97d8783f0bc031b5ce984d0a34d53e07c53e58ba41a60706a7d50afe683eb1c6
MD5 ad9dea23fb0133230d2a0c0d69c0aa51
BLAKE2b-256 3b4b1188d50a8a6dbd5c46359fc0c93f9a862a75060683ef5608e425f0ef0428

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page