hi,

is it intentional that slicing a queryset ignores the Meta_ordering?

for example:

====================================
class Thing(Model):
     name = SlugField()
     pub_date = DateTimeField()

     class Meta:
         ordering = ['-pub_date']
====================================

 >>> Thing.objects.all()

'SELECT <snip> FROM "main_thing" ORDER BY "main_thing"."pub_date" DESC'

this orders correctly



 >>> Thing.objects.all()[0]

SELECT <snip> FROM "main_thing" LIMIT 1

this does not.

 >>> Thing.objects.order_by('-pub_date')[0]

SELECT <snip> FROM "main_thing" ORDER BY "main_thing"."pub_date" DESC 
LIMIT 1


this orders correctly again.


i thought that if i specify the ordering in the Meta class, then it's 
used everywhere...

so, is this a bug, or i'm doing something stupid (again :-) ?

thanks,
gabor

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers
-~----------~----~----~----~------~----~------~--~---

Reply via email to