Skip to main content

Django widgets with tagify.js

Project description

Django Tagify Widget

This is a Django widget that integrates with tagify.js to provide tagging functionality in Django forms.

Features

  • Integrates seamlessly with Django forms.
  • Uses tagify.js for a sleek, modern UI.

Installation

You can install django-tagify-widget using pip:

pip install django-tagify-widget

Requirements

  • Django 2.0.0 or higher
  • Python 3 or higher

Usage

To use the django-tagify-widget in your Django project, simply import it in your forms and use it as you would any standard Django form widget.Example

Here's a simple example of how to use it in a Django form:python

from django import forms
from django.db import models
from tagify_widget.widgets import TagSelect, TagSelectMultiple


# ex_app/models.py of this repogitory
class Book(models.Model):
    MALE = 'M'
    FEMALE = 'F'
    GENDER_CHOICES = [
        (MALE, 'Male'),
        (FEMALE, 'Female'),
    ]
    name = models.CharField(max_length=50);
    gender = models.CharField(max_length=1, choices=GENDER_CHOICES);
    category = models.ForeignKey(
        Type,
        on_delete=models.CASCADE
    )
    makers = models.ManyToManyField(Maker)

    def __str__(self) -> str:
        return self.name


# ex_app/admin.py of this repogitory
class MyModelForm(forms.ModelForm):
    class Meta:
        model = Book
        fields = '__all__'
        widgets = {
            'gender': TagSelect(),
            'category': TagSelect(),
            'makers': TagSelectMultiple(),
        }

Contributing

Contributions to django-tagify-widget are welcome! Please refer to the GitHub repository for more details.Author

License

This project is licensed under the MIT License

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

django_tagify_widget-0.1.3-py3-none-any.whl (33.5 kB view details)

Uploaded Python 3

File details

Details for the file django_tagify_widget-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for django_tagify_widget-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 06dbb02bb0370d5a6714eb1ad0ffbf1ffda576dba5615ef702d08fe721893dbc
MD5 5c1ea9aede0ed1a3e67f81079da3b4c6
BLAKE2b-256 bd5a98683ee76b8b6e5e64b85fc0d8ea306471b9014381ab41a2327fe3c81691

See more details on using hashes here.

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