{ "info": { "author": "Gregor M\u00fcllegger", "author_email": "gregor@muellegger.de", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4" ], "description": "django-superform\n================\n\n**Less sucking formsets.**\n\n|build| |docs| |package| |gitter|\n\nA ``SuperForm`` is absolutely super if you want to nest a lot of forms in each\nother. Use formsets and nested forms inside the ``SuperForm``. The\n``SuperForm`` will take care of its children!\n\n.. note::\n This package is still in rapid development. Some APIs might change in the\n future and it's not yet feature complete. The documentation is not yet\n complete either, but everything that is documented, is up to date and\n should work as stated. If not, then please file a bug.\n Every non-backwards compatible change and new features will be documented\n in the changelog_.\n\n.. _changelog: https://github.com/gregmuellegger/django-superform/tree/master/CHANGES.rst\n\nImagine you want to have a view that shows and validates a form and a formset.\nLet's say you have a signup form where users can enter multiple email\naddresses. Django provides formsets_ for this usecase, but handling those in a\nview is usually quite troublesome. You need to validate both the form and the\nformset manually and you cannot use django's generic FormView_. So here comes\n**django-superform** into play.\n\n.. _formsets: https://docs.djangoproject.com/en/1.6/topics/forms/formsets/\n.. _FormView: https://docs.djangoproject.com/en/1.6/ref/class-based-views/generic-editing/#formview\n\nHere we have an example for the usecase. Let's have a look at the\n``forms.py``:\n\n.. code-block:: python\n\n from django import forms\n from django_superform import SuperModelForm, InlineFormSetField\n from myapp.models import Account, Email\n\n\n class EmailForm(forms.ModelForm):\n class Meta:\n model = Email\n fields = ('account', 'email',)\n\n\n EmailFormSet = modelformset_factory(EmailForm)\n\n\n class SignupForm(SuperModelForm):\n username = forms.CharField()\n # The model `Email` has a ForeignKey called `user` to `Account`.\n emails = InlineFormSetField(formset_class=EmailFormSet)\n\n class Meta:\n model = Account\n fields = ('username',)\n\n\nSo we assign the ``EmailFormSet`` as a field directly to the ``SignupForm``.\nThat's where it belongs! Ok and how do I handle this composite form in the\nview? Have a look:\n\n.. code-block:: python\n\n def post_form(request):\n if request.method == 'POST':\n form = PostForm(request.POST)\n if form.is_valid():\n account = form.save()\n return HttpResponseRedirect('/success/')\n else:\n form = PostForm()\n return render_to_response('post_form.html', {\n 'form',\n }, context_instance=RequestContext(request))\n\n\nNo, we don't do anything different as we would do without having the\n``FormSet`` on the ``SignupForm``. That way you are free to implement all the\nlogic in the form it self where it belongs and use generic views like\n``CreateView`` you would use them with simple forms. Want an example for this?\n\n.. code-block:: python\n\n from django.views.generic import CreateView\n from myapp.models import Account\n from myapp.forms import SignupForm\n\n\n class SignupView(CreateView):\n model = Account\n form_class = SignupForm\n\n\n urlpatterns = patterns('',\n url('^signup/$', SignupView.as_view()),\n )\n\nAnd it just works.\n\nDocumentation\n-------------\n\nFull documentation is available on Read The Docs: https://django-superform.readthedocs.org/\n\n----\n\nDeveloped by Gregor M\u00fcllegger in cooperation with Team23_.\n\n.. _Team23: http://www.team23.de/\n\n.. |build| image:: https://travis-ci.org/gregmuellegger/django-superform.svg?branch=master\n :alt: Build Status\n :scale: 100%\n :target: https://travis-ci.org/gregmuellegger/django-superform\n.. |docs| image:: https://readthedocs.org/projects/django-superform/badge/?version=latest\n :alt: Documentation Status\n :scale: 100%\n :target: https://django-superform.readthedocs.org/\n.. |package| image:: https://badge.fury.io/py/django-superform.svg\n :alt: Package Version\n :scale: 100%\n :target: http://badge.fury.io/py/django-superform\n.. |gitter| image:: https://badges.gitter.im/JoinChat.svg\n :alt: Gitter Chat, discuss django-superform with others\n :scale: 100%\n :target: https://gitter.im/gregmuellegger/django-superform\n\n\nChangelog\n=========\n\n0.3.1\n-----\n\n* ``SuperForm.composite_fields`` dict is not longer shared between form\n instances. Every new form instances get's a deep copy. So changes to it\n won't leak into other instances of the same form class.\n\n0.3.0\n-----\n\n* `#11`_: Fix ``CompositeBoundField`` to allow direct access to nested form\n fields via ``form['nested_form']['field']``.\n* Support for Django's Media handling in nested forms. See `#3`_ and `#5`_.\n* Do not populate errorlist representations without any errors of nested\n formsets into the errors of the super form. See `#5`_ for details.\n\n.. _#3: https://github.com/gregmuellegger/django-superform/issues/3\n.. _#5: https://github.com/gregmuellegger/django-superform/pull/5\n.. _#11: https://github.com/gregmuellegger/django-superform/issues/11\n\n0.2.0\n-----\n\n* Django 1.8 support.\n* Initial values given to the ``__init__`` method of the super-form will get\n passed through to the nested forms.\n* The ``empty_permitted`` argument for modelforms used in a ``ModelFormField``\n is set depending on the ``required`` attribute given to the field.\n\n0.1.0\n-----\n\n* Initial release with proof of concept.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/gregmuellegger/django-superform", "keywords": "", "license": "BSD licence, see LICENSE file", "maintainer": "", "maintainer_email": "", "name": "django-superform", "package_url": "https://pypi.org/project/django-superform/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-superform/", "project_urls": { "Homepage": "https://github.com/gregmuellegger/django-superform" }, "release_url": "https://pypi.org/project/django-superform/0.3.1/", "requires_dist": null, "requires_python": "", "summary": "So much easier handling of formsets.", "version": "0.3.1" }, "last_serial": 1915834, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "9b4a71b551b3ce6bc7e9297224e2a675", "sha256": "1441b7d07ea6558f77f84a52176d1c0ec306d8f8018784c0f0993d5b70239520" }, "downloads": -1, "filename": "django-superform-0.1.0.tar.gz", "has_sig": false, "md5_digest": "9b4a71b551b3ce6bc7e9297224e2a675", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12486, "upload_time": "2014-11-07T11:10:20", "url": "https://files.pythonhosted.org/packages/29/54/3c83facdedc3f473236ba3f3b34d7b12cb9f87ca170fc4cdc72957b04520/django-superform-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "bbf2372d9fa162bd053479c4e5c56244", "sha256": "ba6838f1a35dacac660b8bac540d82e38e6222f37389bce21a48e9f7f069f19e" }, "downloads": -1, "filename": "django-superform-0.2.0.tar.gz", "has_sig": false, "md5_digest": "bbf2372d9fa162bd053479c4e5c56244", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24232, "upload_time": "2015-05-05T09:02:56", "url": "https://files.pythonhosted.org/packages/f2/6d/1994f6526e683e5137f73f08e078d734010ca7e10c99c3a0a67f4336bc1f/django-superform-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "20d0d60673e18d407dfcaa35c396c04e", "sha256": "c9dd821ec56fa9d4cfd464482ed3b2a19a65f4776993bf2985ad7a3891e643ca" }, "downloads": -1, "filename": "django-superform-0.3.0.tar.gz", "has_sig": false, "md5_digest": "20d0d60673e18d407dfcaa35c396c04e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23956, "upload_time": "2016-01-12T08:42:36", "url": "https://files.pythonhosted.org/packages/6d/30/9e55ac811fc841dde275085069dddb76bd0a99b7db1507328635905c5c55/django-superform-0.3.0.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "a00c00cd094d665a8342b820823b1abe", "sha256": "149421eaf0cad3571ed8eb159d95a6020dce8bbb93717bc4303fe804c0164aba" }, "downloads": -1, "filename": "django-superform-0.3.1.tar.gz", "has_sig": false, "md5_digest": "a00c00cd094d665a8342b820823b1abe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24223, "upload_time": "2016-01-21T19:06:55", "url": "https://files.pythonhosted.org/packages/c2/a8/e21b160b66031439157a73c2f84b94d2981f6e5c85fcbcfb4bd11580c3d8/django-superform-0.3.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a00c00cd094d665a8342b820823b1abe", "sha256": "149421eaf0cad3571ed8eb159d95a6020dce8bbb93717bc4303fe804c0164aba" }, "downloads": -1, "filename": "django-superform-0.3.1.tar.gz", "has_sig": false, "md5_digest": "a00c00cd094d665a8342b820823b1abe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24223, "upload_time": "2016-01-21T19:06:55", "url": "https://files.pythonhosted.org/packages/c2/a8/e21b160b66031439157a73c2f84b94d2981f6e5c85fcbcfb4bd11580c3d8/django-superform-0.3.1.tar.gz" } ] }