#7074: MySQL error/warning when 'gt' field lookup with a datetime field and
fulltext search.
-------------------------------------+--------------------------------------
          Reporter:  anonymous       |         Owner:                           
              
            Status:  new             |     Milestone:  1.0                      
              
         Component:  Core framework  |       Version:  SVN                      
              
        Resolution:                  |      Keywords:  qsrf-cleanup mysql, 
fulltext search, gt
             Stage:  Accepted        |     Has_patch:  0                        
              
        Needs_docs:  0               |   Needs_tests:  0                        
              
Needs_better_patch:  0               |  
-------------------------------------+--------------------------------------
Comment (by dcwatson):

 In my patch for [8242], I initially looked into creating a cast function
 for values, in addition to the field cast function there currently. A
 couple notes:

  * The `db_type` values are defined per Field type in the backend's
 creation module (`DATE` and `TIMESTAMP` for Oracle).
  * I tried to implement a generic value casting method, whilst doing away
 with `datetime_cast_sql`. The problem is then you need at least the
 value's type to be passed through (as `value_annot` does now) to the cast
 method.
  * It seems like `value_annot` should be split to avoid it's current dual
 function of knowing when a value evaluates to True/False, and specifying
 the value's type for datetimes. However, that tuple that gets passed
 around is also used by GIS, so it's not completely internal.

 So a generic `rhs_cast_sql` function for Oracle may look something like
 this:

 {{{
 def rhs_cast_sql(self, db_type, value_type):
     if db_type == 'TIMESTAMP' and value_type is datetime.datetime:
         return "TO_TIMESTAMP(%s, 'YYYY-MM-DD HH24:MI:SS.FF')"
     return "%s"
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/7074#comment:10>
Django Code <http://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 post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to