#9208: latest() does not behave as expected for equal timestamps
------------------------------------------+---------------------------------
 Reporter:  [EMAIL PROTECTED]             |       Owner:  nobody    
   Status:  new                           |   Milestone:  post-1.0  
Component:  Database layer (models, ORM)  |     Version:  SVN       
 Keywords:  latest                        |       Stage:  Unreviewed
Has_patch:  1                             |  
------------------------------------------+---------------------------------
 When applying latest() to a field where two or more entries have equal
 timestamps, the entry with the lowest id is returned. What one would
 assume is that in such a case the entry with the highest id is returned.

 Real life example: I run a ticket system that has the requirement of only
 storing the date (and not the time) where the status of the ticket
 changes. When a ticket is opened it is marked as "New". There is a page in
 my ticket system that shows the "New" tickets: i.e. the tickets that have
 "New" as the status returned by latest(). However, those tickets that are
 processed within the same day will still appear in this page. This is
 caused because all the status change entries for each of these tickets are
 in the same day and latest() will return the one with the lowest id.

 I attach a one-line patch that fixes the issue.

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