Skip to main content

Django class based views for using more than one Form in a single view.

Project description

This library allows your to use unlimited number of forms in your views.

Add forms to the dict form_classes, where the key is the form name, and the value is the form class.

By default, in the case of validation, there is form.save(), else there is the error output to the template.

To change this behavior, in the processing form.valid use form_valid_my_form(self, form), and form_invalid_my_form(self, form) for form.invalid.

If you want to fill out the form, use the dict form_initials, where the key is the form name, and the value is the dict, in which the key is field name, and the value is the field value. Ex.: {‘my_form’: {‘first_name’: ‘Denis’, ‘city’: ‘Moscow’}}

Or define a special method get_initials_form_my_form(self), and return the data dictionary.

If you need to update the object, use dict form_instances, where the key in the form name, and the value is the object.

You can also define a special method get_instances_form_my_form(self).

By default, if form proccesing is successful it will be redirected to the same page.

You can change this behavior, by writting a new key and value in the dict form_success_urls.

You can also use a special method get_success_url_form_my_form(self) to procces the redirect site.

Project details


Release history Release notifications | RSS feed

This version

0.5

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-multi-form-0.5.tar.gz (2.8 kB view details)

Uploaded Source

File details

Details for the file django-multi-form-0.5.tar.gz.

File metadata

File hashes

Hashes for django-multi-form-0.5.tar.gz
Algorithm Hash digest
SHA256 d1916dd80b6cd9a828f4265529a422720cfadb26fdf6528cbc95337e5a71e927
MD5 1a8b2a9fad0d124a7dd26be5fd7aa262
BLAKE2b-256 85e860c5d8af59fb1071a29e7d5b879aab55202e6d5bb22ed49cbcd521bbe6a3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page