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
- zzqyu
- Email: wjdrb0626@naver.com
License
This project is licensed under the MIT License
Project details
Release history Release notifications | RSS feed
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)
Built Distribution
Close
Hashes for django-tagify-widget-0.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 038a1be8bce6984613400ee66b6e2080f59799666a9b132d8f5a1873385ae14c |
|
MD5 | fa56d40413e6a650567e3bcfe6bd7631 |
|
BLAKE2b-256 | 7057a744862be72582f83d8c0f1739ce5f762457472ecf808bdd0db9bb2dead9 |
Close
Hashes for django_tagify_widget-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a844493c5b30940a93bb4174fefaaf5f3ccdc81af26aace4f4bf3c51b4e1332c |
|
MD5 | 64499ce0badf03d620a52c3a0e3f42fa |
|
BLAKE2b-256 | f008311be5af4d4f3f1396e9560eda12e16af60438f07c1286f47bc2a23d235c |