#4333: Filtering date gt in SQLite returns identical objects
---------------------------------------------------------+------------------
Reporter:  Michael Snoyman <[EMAIL PROTECTED]>  |       Owner:  adrian          
  Status:  new                                           |   Component:  
Database wrapper
 Version:  SVN                                           |    Keywords:  sqlite 
date     
   Stage:  Unreviewed                                    |   Has_patch:  0      
         
---------------------------------------------------------+------------------
 I'm putting together a very simple blog app, and one feature I put in was
 to have a link to the next newer and older entries. Here's what (the
 relevant parts of) my model looks like:
 
 
 {{{
 class Entry(models.Model):
         when = models.DateField(core=True)
         def newer(self):
                 set =
 Entry.objects.filter(blogger=self.blogger).filter(when__gt=self.when)
                 try:
                         return set[0]
                 except IndexError:
                         return None
 
         def older(self):
                 set =
 Entry.objects.filter(blogger=self.blogger).filter(when__lt=self.when)
                 try:
                         return set[0]
                 except IndexError:
                         return None
 }}}
 
 I run my site using MySQL, and things work properly (ie, for the newest
 entry, newer returns None, etc). On my test environment, I'm using SQLite.
 Older works properly; however, when viewing the newest entry, newer
 returns itself.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/4333>
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