I'm having a strange error on an object query when I try to do negative 
order_by. This is on an Oracle 11 database with Django 1.4
it looks something like:

MyModel.objects.filter(pk=N).order_by('-datetime')[:5]

This gives me valid data for all values of N in the database except for one 
specific record.
This one record works fine when the order_by is on 'datetime', but 
'-datetime' doesn't work.  using .latest('datetime') appears to do the same 
thing (under the hood), so there's no difference in the behavior there.

I'm not sure what the issue is with this specific object, but it does use 
more columns than the rest of the objects in the database.

I have looked at the datetime objects, and they all appear to be good.
I added some additional model fields based on the changes my DBA made to 
this table, but I'm not certain why this would cause this one specific 
object to return nothing where others do, as the data appears good.
any ideas where to look?
I would provide more code but it's of a confidential nature so I'll have to 
scrub any names before I post the models, so I'm hoping someone has an idea 
or hunch before I have to do that.

Thanks, and sorry for not posting much code.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/XDSZwfTqchMJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to