#30321: Add example to Form.changed_data
-------------------------------------+-------------------------------------
     Reporter:  Matthew Pava         |                    Owner:  Bruno
         Type:                       |  Furtado
  Cleanup/optimization               |                   Status:  assigned
    Component:  Documentation        |                  Version:  master
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Bruno Furtado):

 Do you think that just add the output from the snippet is enough?

 {{{
     >>> f = ContactForm(request.POST, initial=data)
     >>> if f.has_changed():
     ...     print("The following fields changed: %s" % ",
 ".join(f.changed_data))
     The following fields changed: subject, message
 }}}


 Or something like this is better?

 {{{
     >>> f = ContactForm(request.POST, initial=data)
     >>> if f.has_changed():
     >>>     print(f.changed_data)
     ['subject', 'message']
 }}}

 Let me know so I can submit a patch for it.  Thank you.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30321#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.d861889245de87cafba6e496624c95a3%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to