> Such a transformation is fine. I found that my Django has no F().
> Checking the Django doc I saw that this new feature is "New in Django
> Development version".
> 
> So I have to wait for the new version? Are there any other ways to
> create such a filter?
>>  col1_value >= col2_value * 2
>>
>> something like col1__gte=F('col2') * 2


You can always fall back to the .extra() method[1]:

   results = MyFoo.objects.extra(where=[
     "col1_value >= col2_value * 2",
     ])

which is how it was done back in the day before ya'll young 
whippersnappers had such fancy shenanigans as F() objects...and 
to get data, we walked up hill, in the snow.  Both ways.  ;-)

-tim


[1]
http://docs.djangoproject.com/en/dev/ref/models/querysets/#extra-select-none-where-none-params-none-tables-none-order-by-none-select-params-none





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to