On 17 July 2013 21:18, Jonathan Slenders <[email protected]>wrote:
> This is really nice. Both have their use cases, but I'm prefering the > second when possible, because it's much more flexible and preserves > database consistency. > With the same efford you can make the following work: > > ProductEntry.objects.filter(lambda p: p.onpurchase_price * p.quantity > == 5000.0) > > Or if you don't like the lambda keyword, extend the Q object. Something > like this: > > ProductEntry.objects.filter(Q(onpurchase_price) * Q(quantity) == 5000.0) > > ISTM it would be more of an extension of ExpressionNode, like F(). -- Curtis -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-developers. For more options, visit https://groups.google.com/groups/opt_out.
