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))
Please login to continue.