Coder Social home page Coder Social logo

mbourqui / django-formset-bootstrap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from elo80ka/django-dynamic-formset

1.0 3.0 2.0 237 KB

A jQuery plugin that allows you dynamically add new forms to a rendered django formset.

License: BSD 3-Clause "New" or "Revised" License

JavaScript 90.37% HTML 1.79% CSS 3.21% Python 1.88% Shell 2.74%

django-formset-bootstrap's Introduction

Python Django License PyPIv PyPIs

A jQuery plugin for managing Django formsets

This jQuery plugin helps you create more usable Django formsets by allowing clients add and remove forms on the client-side.

The latest versions of these documents can be found on the Github web site for this application, which is located at https://github.com/mbourqui/django-dynamic-formset.

Requirements

Installation

Using PyPI

  1. Run pip install django-formset-bootstrap

Using the source code

  1. Make sure Pandoc is installed
  2. Run ./pypi_packager.sh
  3. Run pip install dist/django_formset_bootstrap-x.y.z-[...].wheel, where x.y.z must be replaced by the actual version number and [...] depends on your packaging configuration

Configuration

  1. Add formset-bootstrap to the INSTALLED_APPS in your project's settings (usually settings.py). This is required in order to be able to load the script from the static files of your project.

Usage

In your templates using formsets, be sure to load the static files:

{% load static %}

Then include the script:

<script src="{% static 'formset_bootstrap/js/jquery.formset.js' %}" type="text/javascript"></script>

Finally, set up your dynamic formset:

<script type="text/javascript">
    $(function () {
        $('#formset-id fieldset').formset();
    });
</script>

Setting up the demo project

Once you've got the source code, run the following commands to set up the SQLite3 database and start the development server::

cd demo
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
chmod a+x manage.py
./manage.py syncdb
./manage.py runserver

You can now browse to http://localhost:8000/ and view the examples.

Credits

This is a fork of django-dynamic-formset from elo80ka.

django-formset-bootstrap's People

Contributors

adamestein avatar alilozano avatar amfarrell avatar arhoads avatar elo80ka avatar flanaman avatar greut avatar lemuelf avatar mbourqui avatar olliecook avatar saex avatar tisoo avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

okfish caoh

django-formset-bootstrap's Issues

Cannot add and remove forms on the client-side : what is wrong in my setting

Hi,
I try to use this django-formset-bootstrap but it is unable to add and remove forms on the client-sid as expectation.
I set as your recommendation. Unfortunately, nothing happens.
https://github.com/mbourqui/django-formset-bootstrap

What is something wrong for my configuration???

  1. Already installed.
    js. file has been in D:\ProgramData\Anaconda3\envs\django_apps\Lib\site-packages\formset_bootstrap\static\formset_bootstrap\js
    0

1

  1. added formset-bootstrap to the INSTALLED_APPS settings.py
    2

  2. set loading static and javascript to myformset.html file (this file has been extended from layout.html)
    The figure below partly shown especially relevant django-formset-bootstrap
    3

For more information: In myformset.html consists of 2 forms

  1. Master Form named incident_form.
  2. Detail Form as Formset that will use django-formset-bootstrap
    this HTML file contains some javascript for cascade drop-down list in the master form (it include <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script> you can see in the above picture) , I am not sure whether it cause django-formset-bootstrap not work at the moment

Finally, This is my result. not found both add and delete button or link

4

Please suggest how to configure this package.
Pongthon

cannot install package

pip install django-formset-bootstrap returns this error
Could not find a version that satisfies the requirement django-formset-bootstrap (from versions: )
No matching distribution found for django-formset-bootstrap

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.