Code Monkey home page Code Monkey logo

django-crispy-formset-modal's Introduction

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.

demo-view

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

  1. Install the package using pip:
pip install django-crispy-formset-modal
  1. Add crispy_formset_modal to your INSTALLED_APPS in settings.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

  1. Clone this repository to your local machine:
git clone https://github.com/blasferna/django-crispy-formset-modal.git
  1. Navigate to the project's directory:
cd django-crispy-formset-modal
  1. Set up a virtual environment. This step helps to isolate the Python environment for this project:
python -m venv venv
  1. Activate the virtual environment:

On Windowds

.\venv\Scripts\activate

On Unix or MacOS:

source venv/bin/activate
  1. Install the required dependencies:
pip install -r requirements.txt
  1. Apply migrations:
python manage.py migrate
  1. Start the local development server:
python manage.py runserver
  1. Visit http://localhost:8000 on your browser to explore the demo application.

License

Django Crispy Formset Modal is released under the MIT License.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.