Re: django model filter

2010-09-03 Thread spearsear
I did it in your way, it certainly works. But I feel this is a little ugly. My query is way more complicated that the example here so I had to do if a lot. On Sep 3, 8:29 am, Justin wrote: > Off the top of my head, you could do something like this: > > import math > import django.db.models.Q > >

django model filter

2010-09-02 Thread spearsear
Account.objects.filter(balance__lt=20) selects accounts with balance less than $20 Account.objects.filter(balance__lt=jeff.balance) selects accounts with balance less than the balance of jeff's account Now, How do I do this? accounts with balance whose absolute value is greater than the absolute