Skip to main content

django tag input field

Project description

A django tag input field using Tagify built for Django 2.0. The tags are stored as a comma-delimited (unless if changed) String.

Usage

  1. Models: Use TagsField to represent a tags field.

  2. Forms: Make sure you display form.media in the html template, for the widget to render correctly.

  3. Widget settings: Pass the settings dictionary as follows TagsField(widget_settings={...}.

  • You can specify if ‘duplicates’ are allowed (boolean).

  • You can specify ‘autocomplete’ (boolean) - this matches from the whitelist.

  • You can specify ‘enforceWhitelist’ (boolean).

  • You can specify ‘maxTags’ (int).

  • You can specify the ‘whitelist’ (list containing strings).

  • You can specify the ‘blacklist’ (list containing strings).

  • You can specify the ‘delimiter’ (string).

  • You can specify the RegEx ‘pattern’ to validate the input (string).

If you want to allow blank inputs for tags make sure you set blank=True on TagsField. If blank inputs are allowed, they will not be filtered by the whitelist.

Note: If you use TagsField in a Form, then Form.is_valid() will automatically verify that its values conform to those specify in its settings, to prevent malicious behaviour from end users.

Installation

  1. Install the module

pip install django-tagify
  1. Add django_tagify to your INSTALLED_APPS setting in the Django settings.py.

    Example:

    INSTALLED_APPS = (
        # ...other installed apps
        'django_tagify',
    )

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-tagify-0.20.tar.gz (19.2 kB view details)

Uploaded Source

File details

Details for the file django-tagify-0.20.tar.gz.

File metadata

  • Download URL: django-tagify-0.20.tar.gz
  • Upload date:
  • Size: 19.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for django-tagify-0.20.tar.gz
Algorithm Hash digest
SHA256 8d7c58be3789a19eae67c2f9d5788c442269ed79419c2fdf918d359cfef97c7d
MD5 913a8b7530bfa6b8eaa9d9467561ccf2
BLAKE2b-256 c20b4507f03e6b2f4a6611d64e157fc4c35860955c2b0ac4df5dd9652a8391d9

See more details on using hashes here.

Supported by

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