#19716: Support microsecond precision in MySQL ORM DateTimeField
-------------------------------------+-------------------------------------
     Reporter:  erik@…               |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |               Resolution:
     Severity:  Normal               |             Triage Stage:  Accepted
     Keywords:                       |      Needs documentation:  0
    Has patch:  0                    |  Patch needs improvement:  0
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------

Comment (by sarang (@…):

 This is a 3 line change. Hope Django developers include it.

 In "db/backends/mysql/base.py"
 function "def value_to_db_datetime(self, value)"

 Change from:
         return six.text_type(value.replace(microseconds=0))
 to:
         return six.text_type(value)

 In "db/backends/mysql/base.py"
 function "def value_to_db_time(self, value)"

 Change from:
         return six.text_type(value.replace(microseconds=0))
 to:
         return six.text_type(value)


 In "db/backends/mysql/creation.py"
 In definition of "data_types"

 Change from:
         'DateTimeField':     'datetime',
 to:
         'DateTimeField':     'datetime(6)',

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19716#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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/077.9160635ea64cc45251e97e3555f9b294%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to