forms.Form.changed_data

Form.changed_data

The changed_data attribute returns a list of the names of the fields whose values in the form’s bound data (usually request.POST) differ from what was provided in initial. It returns an empty list if no data differs.

>>> f = ContactForm(request.POST, initial=data)
>>> if f.has_changed():
...     print("The following fields changed: %s" % ", ".join(f.changed_data))
doc_Django
2016-10-09 18:36:51
Comments
Leave a Comment

Please login to continue.