{ "info": { "author": "Kenneth Love", "author_email": "kennethlove@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Django", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Programming Language :: Python :: 3 :: Only", "Topic :: Software Development :: User Interfaces" ], "description": "# django-shapeshifter\n\nA common problem in Django is how to have a view, especially a class-based view\nthat can display and process multiple forms at once. `django-shapeshifter` aims\nto make this problem much more trivial.\n\nRight now, `django-shapeshifter` can handle any (well, theoretically) number of\nforms in a single view. A view class is provided for multiple standard forms\nor model forms. To mix and match these form types, you'll need to do a little\nextra work. Here's how to use the package:\n\n## Installation\n\n`$ pip install django-shapeshifter`\n\nYou should not need to add `shapeshifter` to your `INSTALLED_APPS`.\n\n## Usage\n\nYou use `django-shapeshifter` just like you use Django's built-in class-based\nviews. You should be able to use the provided views with most mixins you're\nalready using in your project, such as `LoginRequiredMixin`. Certain mixins may have to be refactored, such as `SuccessMessageMixin`, which is trigged on the `form_valid()` method. \n\nLet's look at using the view with a few standard forms:\n\n*interests/views.py*\n```python\nfrom django.urls import reverse_lazy\n\nfrom shapeshifter.views import MultiFormView\n\nfrom . import forms\n\n\nclass InterestFormsView(MultiFormView):\n form_classes = (forms.ContactForm, forms.InterestsForm, forms.GDPRForm)\n template_name = 'interests/forms.html'\n success_url = reverse_lazy('interests:thanks')\n```\n\nBut what do you need to do in the template? The view's context will contain\na new member, `forms`, that you can iterate over to display each form:\n\n*interests/templates/interests/forms.html*\n```html\n{% extends 'layout.html' %}\n\n{% block content %}\n