It seems to me that you have to transform your fields lookup like that :
col1_value >= col2_value * 2
something like col1__gte=F('col2') * 2
Frédéric
2009/7/24 David <[email protected]>:
>
> Hello,
>
> Here is a table "myTable" with columns of "col1", "col2", "col3", ...,
> "col5". The types of these columns are all float. Now for two values
> from any two columns of these columns, I may need to add, or subtract,
> or multiply or divide these two values. With this result, I do a
> condition check.
>
> For example, I want to retrieve all objects that meet "col1_value /
> col2_value >= 2.0". How to create such a filter? It seems to me that F
> () might be the right choice, however the document on this part in
> QuerySet API is quite rough.
>
> Anybody knows how to create such a filter? or anybody knows any url
> links that introduce F() in details?
>
> Thanks so much.
> >
>
--
http://www.openidfrance.fr/fhebert
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---