#9619: to_python not called when fetching data with .values(...)
-------------------------------------+-------------------------------------
Reporter: Valera Grishin | Owner: nobody
Type: Bug | Status: new
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: values,custom | Triage Stage: Accepted
field, datetime |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by jedie):
If i see it right, this has been fixed with Django v1.8 and the change
from {{{to_python()}}} to {{{from_db_value()}}} isn't it?
The docs at https://docs.djangoproject.com/en/1.8/howto/custom-model-
fields/#converting-values-to-python-objects says:
{{{
If present for the field subclass, from_db_value() will be called in all
circumstances when the data is loaded from the database, including in
aggregates and values() calls.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/9619#comment:19>
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/072.c29a2f6599b67321a7594de3532e06de%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.