Re: Problem with order_by on one record only

2012-07-31 Thread Alex Umrysh
Just to update this in case anyone else has a similar problem... I used a DecimalField where the database had a Float value, so I switched it to a FloatField in my models and it fixed the problem. Of course, some precision may be lost in doing this, but considering the values I'm reading are ac

Re: Problem with order_by on one record only

2012-06-15 Thread Kurtis Mullins
You could try grabbing the exact SQL statement(s) executed for this query and run them yourself on the Oracle Database. At least that would tell you if the problem lay in Django or not. Then, maybe use a debugger to step through the query (try using ipdb or something similar) and see where it gets

Problem with order_by on one record only

2012-06-15 Thread Alex Umrysh
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