#659: Selecting by month with DateField is broken with sqlite3 backend
------------------------+---------------------------------------------------
   Reporter:  pgross    |                Owner:  adrian          
     Status:  reopened  |            Component:  Database wrapper
    Version:            |           Resolution:                  
   Keywords:            |                Stage:  Accepted        
  Has_patch:  0         |           Needs_docs:  0               
Needs_tests:  1         |   Needs_better_patch:  0               
------------------------+---------------------------------------------------
Comment (by shaleh):

 I do not see any issues with current 6780 trunk.

 class Person(models.Model):
     name = models.CharField(max_length=30)
     birthday = models.DateField()

     class Meta:
         ordering = ['birthday', 'name']

     def __unicode__(self):
         return u"%s, %s" % (self.name, self.birthday)

 >>> Person.objects.all()
 >>> [<Person: John, 1965-04-30>, <Person: Charles, 2001-03-24>]

 >>> Person.objects.filter(birthday__year=1965)
 >>> [<Person: John, 1965-04-30>]

 >>> Person.objects.filter(birthday__month=4)
 >>> [<Person: John, 1965-04-30>]

 >>> print django.db.backend
 <module 'django.db.backends.sqlite3.base' from
 '/home/shaleh/repos/django/django/db/backends/sqlite3/base.pyc'>

 I am using Debian's python-pysqlite2 package version 2.3.5-1.

 The thread referenced in the previous comment seems to be discussing a
 different problem.

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