Re: [Django] #14638: to_python howto documentation improvement

22 views
Skip to first unread message

Django

unread,
Jun 16, 2014, 3:11:09 PM6/16/14
to django-...@googlegroups.com
#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 jorgecarleitao):

I think this was fixed when docs for custom fields were added, see
https://docs.djangoproject.com/en/1.6/howto/custom-model-fields/#the-
subfieldbase-metaclass and https://docs.djangoproject.com/en/1.6/howto
/custom-model-fields/#django.db.models.Field.to_python

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

Django

unread,
Jun 17, 2014, 10:00:34 AM6/17/14
to django-...@googlegroups.com
#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 timo):

@jorgecarleitao, did you read the comments on this ticket? The report is
describing issues with those docs you linked -- there hasn't been anything
added since this report as far as I've seen.

--
Ticket URL: <https://code.djangoproject.com/ticket/14638#comment:9>

Django

unread,
Jul 10, 2014, 7:05:55 AM7/10/14
to django-...@googlegroups.com
#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):

With better documentation in
[https://github.com/django/django/commit/e1fa7dffdc1b141cb858160890d448ca778366e4
e1fa7df], I think now the various usage of `to_python` is clear now.
IMO we can close this now.

--
Ticket URL: <https://code.djangoproject.com/ticket/14638#comment:10>

Django

unread,
Jul 10, 2014, 7:06:31 AM7/10/14
to django-...@googlegroups.com
#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 |
-------------------------------------+-------------------------------------
Changes (by anubhav9042):

* cc: anubhav9042@… (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/14638#comment:11>

Django

unread,
Jul 10, 2014, 9:44:59 AM7/10/14
to django-...@googlegroups.com
#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 timo):

Have you read the comments above and taken time to understand the nuances
(I haven't)? For example, in comment 4 it says: "I will make a quote from
the docs as an example: [quote] This is not true." I am not sure if the
report is correct or not, but that paragraph remains unaltered even after
the commit you mentioned.

--
Ticket URL: <https://code.djangoproject.com/ticket/14638#comment:12>

Django

unread,
Jul 10, 2014, 11:10:38 AM7/10/14
to django-...@googlegroups.com
#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

unread,
Jul 10, 2014, 11:12:50 AM7/10/14
to django-...@googlegroups.com
#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):

What do you suggest?

--
Ticket URL: <https://code.djangoproject.com/ticket/14638#comment:14>

Django

unread,
Aug 18, 2014, 12:54:03 PM8/18/14
to django-...@googlegroups.com
#14638: to_python howto documentation improvement
-------------------------------------+-------------------------------------
Reporter: maraujop | Owner: nobody
Type: | Status: closed
Cleanup/optimization | Version: master
Component: Documentation | Resolution: fixed

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 |
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

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


Comment:

In [changeset:"b6aa60f4252311ef8ef24b4ffd99984197be7ee6"]:
{{{
#!CommitTicketReference repository=""
revision="b6aa60f4252311ef8ef24b4ffd99984197be7ee6"
Fixed #14638 -- Clarified model Field.to_python() docs.

Thanks Anubhav Joshi for the patch.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/14638#comment:15>

Django

unread,
Aug 18, 2014, 12:56:44 PM8/18/14
to django-...@googlegroups.com
#14638: to_python howto documentation improvement
-------------------------------------+-------------------------------------
Reporter: maraujop | Owner: nobody
Type: | Status: closed
Cleanup/optimization | Version: master
Component: Documentation | Resolution: fixed
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 Tim Graham <timograham@…>):

In [changeset:"d818e02134ae719108e12b24a7da7416328c2190"]:
{{{
#!CommitTicketReference repository=""
revision="d818e02134ae719108e12b24a7da7416328c2190"
[1.7.x] Fixed #14638 -- Clarified model Field.to_python() docs.

Thanks Anubhav Joshi for the patch.

Backport of b6aa60f425 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/14638#comment:16>

Django

unread,
Aug 18, 2014, 12:56:44 PM8/18/14
to django-...@googlegroups.com
#14638: to_python howto documentation improvement
-------------------------------------+-------------------------------------
Reporter: maraujop | Owner: nobody
Type: | Status: closed
Cleanup/optimization | Version: master
Component: Documentation | Resolution: fixed
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 Tim Graham <timograham@…>):

In [changeset:"955fdc8cdb0c1a98741687513980b64de8f20c75"]:
{{{
#!CommitTicketReference repository=""
revision="955fdc8cdb0c1a98741687513980b64de8f20c75"
[1.6.x] Fixed #14638 -- Clarified model Field.to_python() docs.

Thanks Anubhav Joshi for the patch.

Backport of b6aa60f425 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/14638#comment:17>

Reply all
Reply to author
Forward
0 new messages