#23549: Model form's model_to_dict using value_from_object instead of to_python
-------------------------------------+-------------------------------------
     Reporter:  mwaterfall           |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Forms                |                  Version:  1.7
     Severity:  Normal               |               Resolution:  invalid
     Keywords:  form, modelform,     |             Triage Stage:
  field                              |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by timgraham):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 In the case of `ModelChoiceField`, `to_python()` might return a model
 class while `value_from_object()` returns the value's pk such as an
 integer or string. To learn more, make the change you suggest and run
 Django's test suite and see what fails.

 As it isn't evident there is a bug in Django, please see
 TicketClosingReasons/UseSupportChannels for ways to get help. Please
 reopen if you can provide more details that suggests this is indeed a bug
 in Django and not in the custom field. Thanks.

--
Ticket URL: <https://code.djangoproject.com/ticket/23549#comment:2>
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/068.e89503599862d2ed81c2a54485165b85%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to