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
.
- Run
pip install django-formset-bootstrap
- Make sure Pandoc is installed
- Run
./pypi_packager.sh
- Run
pip install dist/django_formset_bootstrap-x.y.z-[...].wheel
, wherex.y.z
must be replaced by the actual version number and[...]
depends on your packaging configuration
- Add
formset-bootstrap
to theINSTALLED_APPS
in your project's settings (usuallysettings.py
). This is required in order to be able to load the script from the static files of your project.
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>
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.