#14638: to_python howto documentation improvement
-------------------------------------+-------------------------------------
     Reporter:  maraujop             |                    Owner:  nobody
         Type:                       |                   Status:  new
  Cleanup/optimization               |                  Version:  master
    Component:  Documentation        |               Resolution:
     Severity:  Normal               |             Triage Stage:  Accepted
     Keywords:  to_python, model,    |      Needs documentation:  0
  field                              |  Patch needs improvement:  0
    Has patch:  0                    |                    UI/UX:  0
  Needs tests:  0                    |
Easy pickings:  0                    |
-------------------------------------+-------------------------------------

Comment (by anubhav9042):

 Replying to [comment:12 timo]:
 Yes I have gone though the docs and understood the situation.
 Earlier the entire docs for `to_python` was in custom_field docs but now
 it is not. It has been moved to appropriate place where it mentions its
 usual purpose of `Converts a value as returned by the database (or a
 serializer) to a Python object.` and also mentions `See converting-
 database-values-to-python-objects for usage.`, see
 
[https://github.com/django/django/commit/e1fa7dffdc1b141cb858160890d448ca778366e4
 #diff-7e6909c7694e8a3ae170c2a22f9b6e0cR1618 here], where it mentions about
 its extra purpose of being used with `SubFieldBase` and this same is said
 in the docs for `SubFieldBase`.

 I know that lines haven't been changed, but I felt that this way of
 representation cleared everything. Whatever the doubt was, it was about
 the two different usages of `to_python` which is surely mentioned under
 proper headings now, so I don't think anything else is required.

 At max, we can change the link `See converting-database-values-to-python-
 objects for usage.` to `See converting-database-values-to-python-objects
 for various usages.` and line `If your custom field needs the to_python
 method to be called when it is created, you should be using The
 SubfieldBase metaclass mentioned earlier.` to `If your custom field needs
 the to_python method to be called everytime it is created along with its
 usual usage, you should be using The SubfieldBase metaclass mentioned
 earlier.`

-- 
Ticket URL: <https://code.djangoproject.com/ticket/14638#comment:13>
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/066.61e38e3b911d7f2791a7f77ebe1c9a22%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to