On Monday, 9 June 2014 21:28:51 UTC+1, Tim Martin wrote:
>
>
> On Monday, 9 June 2014 20:44:08 UTC+1, Tim Martin wrote:
>>
>>
>> I'll go ahead and try to implement this using __neg__() to invert the 
>> ordering.
>>
>>
> It's still pretty rough, but there's some code in 
> https://github.com/timmartin/django/tree/order_by_expressions that 
> appears to work. In particular, I haven't yet implemented the LowerCase and 
> related functions (I have one, but it's just a test hack), but that should 
> just be boiler-plate.
>
>
And I should have noted that I haven't implemented detection of negation in 
contexts other than ORDER BY. It's not easy to do it cleanly with the 
simple approach I've got at the moment. The code could just check that 
get_ordering() returns ASC, but a) that's gross and b) it doesn't solve the 
problem of having unary negative on a subexpression, which would get 
ignored.

Tim

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/0018b11b-0e82-44d8-856c-0d43f435013e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to