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 Distribution

django-tagify-widget-0.1.1.tar.gz (31.9 kB view hashes)

Uploaded Source

Built Distribution

django_tagify_widget-0.1.1-py3-none-any.whl (33.3 kB view hashes)

Uploaded Python 3

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