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? Any ideas? Thanks again. On Jul 24, 2:01 pm, Frédéric Hébert <[email protected]> wrote: > 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- Hide quoted text - > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

