{ "info": { "author": "Raphael Michel", "author_email": "mail@raphaelmichel.de", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "==========================\ndjango-formset-js-improved\n==========================\n\n**This is a fork of django-formset-js that adds support for reordering and nested formsets.**\n\nThe fork was done because the original author (Tim Heap) did not get around merging my PRs and I \nneed this to be on PyPI so I can depend on it. Please don't expect this fork to be permanently\nmaintained.\n\nA wrapper for a JavaScript formset helper.\n\nInstalling\n----------\n\nInstall via pip::\n\n pip install django-formset-js-improved\n\nThen add it and its dependancy ``django-jquery-js``\nto your ``INSTALLED_APPS``:\n\n.. code-block:: python\n\n INSTALLED_APPS += (\n 'django.contrib.staticfiles',\n 'jquery',\n 'djangoformsetjs',\n )\n\nUsing\n-----\n\nInclude the JavaScript library\n******************************\n\nBoth jQuery and this library must be included in your page.\nThe simplest way to do this is to add the scripts as media dependencies on your form:\n\n.. code-block:: python\n\n from djangoformsetjs.utils import formset_media_js\n\n class MyForm(forms.Form):\n class Media(object):\n js = formset_media_js + (\n # Other form media here\n )\n\n MyFormSet = formset_factory(MyForm)\n\nAnd then include the Media of the form in your template:\n\n.. code-block:: html+django\n\n {{ formset.media }}\n\nAlternatively, simply add the script tags:\n\n.. code-block:: html+django\n\n \n \n\nRender the formset\n******************\n\nSo that the library can work with your formset,\ncertain blocks of your formset need to be marked up with ``data-formset-...`` attributes:\n\n.. code-block:: html+django\n\n {% load formset_tags %}\n\n
\n {{ formset.management_form }}\n\n
\n \n {% for form in formset %}\n
\n {{ form }}\n \n \n \n
\n {% endfor %}\n
\n\n \n \n\n \n \n\n \n\n
\n\nThe ``data-formset-`` data attributes are:\n\n``data-formset-prefix``\n The value of ``{{ formset.prefix }}``.\n This is used to find the management form.\n\n``data-formset-body``\n This indicates where all the child forms are.\n New forms are inserted in here.\n\n``data-formset-form``\n Every form (including the empty form) should have this attribute.\n\n``data-formset-empty-form``\n The element that contains the empty form template.\n For best results, use a ``