Without any filtering, I can execute the following SQL query to get my
ordered data:
   SELECT * from EXECUTION_JOB ORDER BY GREATEST(startTime, queueTime)
DESC;

But in Django, it seems like the order_by only likes passing of field
names, not a function call.
Is there a way to have it bass a raw ORDER_BY value to the query?

I am getting my filtered query in a variable called "jobs"
I tried calling
    jobs.order_by('GREATEST(startTime,queueTime)')
but this fails due to:
   FieldError: Invalid order_by arguments:
['GREATEST(startTime,queueTime)']

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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