Login

check if form has changed (deprecated)

Author:
guettli
Posted:
February 28, 2008
Language:
Python
Version:
.96
Score:
0 (after 0 ratings)

This is deprecated. I don't use it anymore, since forms now have the attribute "has_changed".

The method form_changed() returns a boolean value. It is True if the submitted values of the bound and valid form are different than the initial values.

It works for me. Feedback welcome.

Set debug=True if you want to know what's going on.

1
# code was removed, because django has form.changed_data since a long time.

More like this

  1. Template tag - list punctuation for a list of items by shapiromatron 9 months, 3 weeks ago
  2. JSONRequestMiddleware adds a .json() method to your HttpRequests by cdcarter 10 months ago
  3. Serializer factory with Django Rest Framework by julio 1 year, 4 months ago
  4. Image compression before saving the new model / work with JPG, PNG by Schleidens 1 year, 5 months ago
  5. Help text hyperlinks by sa2812 1 year, 6 months ago

Comments

guettli (on September 17, 2008):

At least since django 1.0 forms have method has_changed() and an attribute "changed_data". I (the author of this snippet) will use has_changed() instead of this snippet in new code.

#

Please login first before commenting.