1
0
mirror of https://github.com/django/django.git synced 2025-04-18 06:14:37 +00:00

[2.2.x] Fixed -- Added example of changed_data to forms docs.

Backport of 571ab44e8a8936014c22e7eebe4948d9611fd7ce from master
This commit is contained in:
Bruno Furtado 2019-04-09 22:52:33 +02:00 committed by Mariusz Felisiak
parent b88ffef7ea
commit bfe279293c

@ -299,6 +299,8 @@ provided in :attr:`~Form.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))
>>> f.changed_data
['subject', 'message']
Accessing the fields from the form
==================================