Metadata-Version: 2.4
Name: django-dropulous
Version: 0.1.0
Summary: Django form widgets for Dropulous
Author-email: Richard Terry <code@radiac.net>
License-Expression: BSD-3-Clause
Project-URL: Homepage, https://radiac.net/projects/django-dropulous/
Project-URL: Documentation, https://django-dropulous.readthedocs.io/en/latest/
Project-URL: Changelog, https://django-dropulous.readthedocs.io/en/latest/changelog.html
Project-URL: Repository, https://github.com/radiac/django-dropulous
Project-URL: Issues, https://github.com/radiac/django-dropulous/issues
Keywords: django,forms,select,autocomplete
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: Django
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: django>=5.2
Dynamic: license-file

# django-dropulous

[![PyPI](https://img.shields.io/pypi/v/django-dropulous.svg)](https://pypi.org/project/django-dropulous/)
[![Documentation](https://readthedocs.org/projects/django-dropulous/badge/?version=latest)](https://django-dropulous.readthedocs.io/en/latest/)
[![Tests](https://github.com/radiac/django-dropulous/actions/workflows/ci.yml/badge.svg)](https://github.com/radiac/django-dropulous/actions/workflows/ci.yml)
[![Coverage](https://codecov.io/gh/radiac/django-dropulous/branch/main/graph/badge.svg)](https://codecov.io/gh/radiac/django-dropulous)

Django form widgets for [Dropulous](https://github.com/radiac/dropulous) -
dependency-free customisable dropdown controls.


## Features

* `DropulousWidget` and `DropulousMultipleWidget` - widgets to use with a model form
* `DropulousChoiceField` and `DropulousMultipleChoiceField` - form fields to use in
  standard forms
* `AutocompleteView` and `ModelAutocompleteView` - API views to serve dropdown options

Django-Dropulous does *not* support Dropulous on `<input>` fields,  or its
`can-add` option. For that, you'll want to use
[django-tagulous](https://github.com/radiac/django-tagulous) - it has a
``SingleTagField`` to allow custom choices on `ForeignKey` relationships, and a
``TagField`` for a full tagging system on `ManyToMany` relationships, with proper tag
parsing, tree-based tags, and more.


## Quick start

```bash
pip install django-dropulous
```

```python
# settings.py
INSTALLED_APPS = [
    ...
    "django_dropulous",
]
```

```python
# forms.py
from django_dropulous.widgets import DropulousWidget, DropulousMultipleWidget


class BookForm(forms.ModelForm):
    class Meta:
        model = Book
        fields = ["genre", "authors"]
        widgets = {
            "genre": DropulousWidget(),
            "authors": DropulousMultipleWidget(source="/autocomplete/authors/"),
        }
```

Read the [full documentation](https://django-dropulous.readthedocs.io/en/latest/) or
find the project on [PyPI](https://pypi.org/project/django-dropulous/).
