django-tagging-autocomplete-new
django-tagging-autocomplete-new is a jquery based autocomplete solution for django-tagging.
This is fixed version of django-tagging-autocomplete by @ludwiktrammer for Django 2.2.
Requirements
django-tagging
Setup
- Install package from PyPI:
pip install django-tagging-autocomplete-new
- Add
taggingandtagging-autocomplete-newto installed apps in your's project's settings:
INSTALLED_APPS = [
...
'tagging',
'tagging_autocomplete_new',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.sites',
'django.contrib.staticfiles',
...
]
- Add route to your project's
urls.pyfile:
path('tagging_autocomplete_new/', include('tagging_autocomplete_new.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_new.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_new.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
Metadata
Release files for django-tagging-autocomplete-new 0.6.3
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-tagging-autocomplete-new-0.6.3.tar.gz | 54.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_tagging_autocomplete_new-0.6.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 134.2 kB
Release files / django-tagging-autocomplete-new-0.6.3.tar.gz
| Download URL | django-tagging-autocomplete-new-0.6.3.tar.gz |
|---|---|
| Size | 54.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1521b1cb76eb512c3be8387a7afdfaaeb1214183524f1017ee2b6a4eaeabe181
|
|
BLAKE2b-256 checksum How to use checksums |
5bdaec69b7ecb80692a70ccc1b5f3edd729b4a77e6e796e43b67dc51134531d1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.8.2
|
Release files / django_tagging_autocomplete_new-0.6.3-py3-none-any.whl
| Download URL | django_tagging_autocomplete_new-0.6.3-py3-none-any.whl |
|---|---|
| Size | 79.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
17d692976e355276a638eea7ec2de7fc7c89cf934d33fbbb7715a59f07c462cf
|
|
BLAKE2b-256 checksum How to use checksums |
336bff53012ba4fcb3747539b4a2ed76b91b851df59c9d0a64f5c55ae9770475
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.44.1 CPython/3.8.2
|