Django app that provides an easy way to manage and manipulate formsets using modals with Django Crispy Forms.
Project description
django-crispy-formset-modal
Reusable Django app that provides an easy way to manage and manipulate formsets using modals with Django Crispy Forms. It enables you to dynamically add, edit, and delete formsets on the frontend.
Features
- Dynamic formset operations: Add, edit, and delete formsets dynamically in a modal on the frontend.
- Generates an HTML table according to the layout definition, allowing you to determine which fields to display as columns.
- Provides the option to define which numeric fields will be used for a totalizer at the footer of the corresponding field's column.
- Enables mass deletion of records from the HTML table, thanks to the generation of a selection column with checkboxes that can be selected individually or collectively to delete multiple records at once.
- Offers support for various templates packs, including Bootstrap 4, Bootstrap 5, Tailwind, and Bulma.
Dependencies
- Django Crispy Forms: Django Crispy Formset Modal relies on Django Crispy Forms for form rendering
- Django Extra Views: For handling views with formsets.
- jQuery: Used to enable dynamic functionality.
Installation
- Install the package using pip:
pip install django-crispy-formset-modal
- Add
crispy_formset_modal
to yourINSTALLED_APPS
insettings.py
:
INSTALLED_APPS = [
...
'crispy_formset_modal',
...
]
Usage
For detailed instructions on how to use Django Crispy Formset Modal, please refer to the documentation and check out the demo for practical examples.
Examples
The demo provides various examples of how to use Django Crispy Formset Modal in different scenarios.
Running the Demo App Locally
If you'd like to run the demo application on your local machine. Please follow the steps below:
Instructions
- Clone this repository to your local machine:
git clone https://github.com/blasferna/django-crispy-formset-modal.git
- Navigate to the project's directory:
cd django-crispy-formset-modal
- Set up a virtual environment. This step helps to isolate the Python environment for this project:
python -m venv venv
- Activate the virtual environment:
On Windowds
.\venv\Scripts\activate
On Unix or MacOS:
source venv/bin/activate
- Install the required dependencies:
pip install -r requirements.txt
- Apply migrations:
python manage.py migrate
- Start the local development server:
python manage.py runserver
- Visit
http://localhost:8000
on your browser to explore the demo application.
License
Django Crispy Formset Modal is released 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
Built Distribution
File details
Details for the file django_crispy_formset_modal-0.12.tar.gz
.
File metadata
- Download URL: django_crispy_formset_modal-0.12.tar.gz
- Upload date:
- Size: 39.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c350f5d2489bcfe0132152edbb2c6862efeaa192e828d3f604204d9cab68cb7 |
|
MD5 | 05ad5ccfc2f41b790131578dafee024d |
|
BLAKE2b-256 | cde8905a8b8218cdd884ca420f80e90f20314b2c3d55231a958ef7324fbf4224 |
File details
Details for the file django_crispy_formset_modal-0.12-py2.py3-none-any.whl
.
File metadata
- Download URL: django_crispy_formset_modal-0.12-py2.py3-none-any.whl
- Upload date:
- Size: 51.0 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | be68af0397ad2ac62a8b4b2d8fd1ba6e0cd37e72008ff940e32ab30a3c352a6d |
|
MD5 | feb5e27394daf4a54b70ebfa92e01e55 |
|
BLAKE2b-256 | 626565b125d2e852f1fb2e132cda7181eaf6f0f169f4a59f2fe283c420fb6a22 |