#2008: Negative offset in DB query set array-slicing fails silently
------------------------------+---------------------------------------------
 Reporter:  [EMAIL PROTECTED]    |       Owner:  adrian
     Type:  defect            |      Status:  new   
 Priority:  normal            |   Milestone:        
Component:  Database wrapper  |     Version:  SVN   
 Severity:  normal            |    Keywords:        
------------------------------+---------------------------------------------
 Ordinary Python array-slicing allows negative offsets to indicate
 accessing items from the end of an array, e.g.
 {{{
 l = ["foo", "bar", "baz"]
 l[-1] <- returns "baz"
 l[-2] <- returns "bar"
 }}}
 
 The same apparently does not work for querysets if they are not evaluated.
 Instead it fails silently. I've looked up the reference for select
 statements in SQLite and MySQL without finding anything obvious to remedy
 the problem, other than to reverse the ordering if present. But at least
 Django should give an error and not fail silently.
 
 I'm using the syntax to extract the first and the last item of a sequence
 to summarize a larger set of items.

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

Reply via email to