#30224: Mysql Datetime value is string instead of datetime object
-------------------------------------+-------------------------------------
     Reporter:  Martin Kuhn          |                    Owner:  nobody
         Type:  Bug                  |                   Status:  new
    Component:  Database layer       |                  Version:  2.2
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  Mysql                |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

 * stage:  Unreviewed => Accepted


Comment:

 Thanks for the investigation Martin, it's greatly appreciated.

 I agree that the most straightforward solution for the datetime would be
 to adapt `convert_datetimefield_value` but it'd be great to figure out if
 other types are affected as well (e.g. decimal, floats, ...) so we can
 figure out if the solution needs to live at the
 `Aggregate(filter).as_mysql` level as well.

 Could you possible try to figure if it's the case?

 I also wonder if it could be possible to let `mysqlclient` know what the
 expected type is for a specific cursor instead though. We have this
 information in the compiler (through `.output_field`) so if we can provide
 per-cursor converter hints I assume it would be even more efficient
 because it would be performed in C. Another option is figuring out if
 `mysqlclient` can somehow figure out how to introspect such return value
 on it's own (e.g. maybe MySQL returns a different field type in this case)
 but in all cases we'll have to ship a Django workaround anyway.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/30224#comment:9>
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/065.1ffbdf744bbec0585b0251c2bb961ba1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to