#3501: [patch] sqlite selection on datetime members fail when datefield is null
-------------------------+--------------------------------------------------
   Reporter:  anonymous  |                Owner:  adrian          
     Status:  new        |            Component:  Database wrapper
    Version:  SVN        |           Resolution:                  
   Keywords:  sqlite     |                Stage:  Accepted        
  Has_patch:  1          |           Needs_docs:  0               
Needs_tests:  1          |   Needs_better_patch:  0               
-------------------------+--------------------------------------------------
Changes (by anonymous):

  * needs_better_patch:  1 => 0
  * summary:  sqlite selection on datetime members fail when datefield is
              null => [patch] sqlite selection on datetime
              members fail when datefield is null

Comment:

 Okay... i've confirmed testing for None fixes the problem, added a
 newline, but i'm not yet up to creating a test case.
 Regards, Niels Poppe
 
 {{{
 
 Index: django/db/backends/sqlite3/base.py
 ===================================================================
 --- django/db/backends/sqlite3/base.py  (revision 4528)
 +++ django/db/backends/sqlite3/base.py  (working copy)
 @@ -119,6 +119,8 @@
      return 'django_extract("%s", %s)' % (lookup_type.lower(), table_name)
 
  def _sqlite_extract(lookup_type, dt):
 +    if dt is None:
 +        return None
      try:
          dt = util.typecast_timestamp(dt)
      except (ValueError, TypeError):
 
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/3501#comment:2>
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