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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file django-multi-form-0.5.tar.gz
.
File metadata
- Download URL: django-multi-form-0.5.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1916dd80b6cd9a828f4265529a422720cfadb26fdf6528cbc95337e5a71e927 |
|
MD5 | 1a8b2a9fad0d124a7dd26be5fd7aa262 |
|
BLAKE2b-256 | 85e860c5d8af59fb1071a29e7d5b879aab55202e6d5bb22ed49cbcd521bbe6a3 |