Skip to main content

django-tagify2

GitHub version License: GPL v3

django tag input field

alt tag

alt tag

Credits

Requirements

  • python3+

  • django 2.0+ (maybe 1.x)

Documentation

Installation

  • download

pip install django-tagify2
or
pip install --index-url https://pypi.org/simple/ django-tagify2
  • Add ‘tagify’ application to the INSTALLED_APPS

INSTALLED_APPS = [
    ...
    'tagify',
]
  • Make sure APP_DIRS is True in TEMPLATES

TEMPLATES = [
    ...
    'APP_DIRS': True,
                ...
]

Usage

Quick Start

The form class

Building a form in Django like this:

from django import forms
from tagify.fields import TagField


class TagForm(forms.Form):
    languages = TagField(label='languages', place_holder='add a language', delimiters=' ',
                         data_list=['Python', 'Java', 'PHP', 'Golang', 'JavaScript'], initial='Python Golang')


# or
def random_number():
    return [random.randint(10, 19), random.randint(10, 19), random.randint(10, 19), random.randint(10, 19), ]


class NumberForm(forms.Form):
    number = TagField(label='number', place_holder='add a number', delimiters=' ',
                      data_list=random_number)


# or
class TagForm(forms.Form):
    languages = TagField(label='languages', place_holder='add a language', delimiters=' ', )

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.fields['languages'].set_tag_args('data_list', get_languages())

The view

To handle the form we need to instantiate it in the view for the URL where we want it to be published:

from django.http import HttpResponse
from django.shortcuts import render

from example.forms import TagForm


def index(request):
    if request.method == 'POST':
        form = TagForm(request.POST)
        if form.is_valid():
            return HttpResponse(str(form.cleaned_data['languages']))
    else:
        form = TagForm()
    return render(request, 'index.html', {'form': form})

The template

The simplest example is:

<head>
    {{ form.media }}
</head>
<body>
  <form action="" method="post">
      {% csrf_token %}
      {{ form }}
      <br>
      <input type="submit" value="OK">
  </form>
</body>

Using With Model

```python from django.db import models

from tagify.models import TagField

class People(models.Model): name = models.Cha

Metadata

Release files for django-tagify2 1.0.19

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-tagify2 1.0.19
File Size Uploaded Provenance Actions
django-tagify2-1.0.19.tar.gz 39.8 kB Without provenance Details for django-tagify2-1.0.19.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-tagify2 1.0.19
File Interpreter ABI Platform Actions
django_tagify2-1.0.19-py3-none-any.whl Python 3 none any Details for django_tagify2-1.0.19-py3-none-any.whl

Total release size: 80.9 kB

Release files / django-tagify2-1.0.19.tar.gz

Download URL django-tagify2-1.0.19.tar.gz
Size 39.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e099cf4f33cdc6ca9b9064999adde93e6f4051f849e9ca794a9738a5f57b6049
BLAKE2b-256 checksum
How to use checksums
ceb85be69f954a3d81637dad208656c49d2af4c3161afb704ff0c35be1f44742
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.6

Release files / django_tagify2-1.0.19-py3-none-any.whl

Download URL django_tagify2-1.0.19-py3-none-any.whl
Size 41.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
439d40ffbfae2556beebd96ac8c6ac5e336d929e0f811c736489713c2b7b8b92
BLAKE2b-256 checksum
How to use checksums
3a3f275a3d3562185fc19a050a5d00508125bf54737455ea93d96425ac7570c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.6

Security for django-tagify2 1.0.19

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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