Oh sorry, it was really easy...
field = field + " = "
lista = db.Query(FOOD).filter(field,food).order('-Date').fetch(limit=30)
Now it's working....
thanks
Massimiliano
2010/6/2 andreas schmid <[email protected]>
> i think what you are missing in your code is the operator after the field
> var in the filter. (= , < , >,...)
>
> you use it like .filter('field =', 'value')
>
> On Jun 2, 2010, at 12:57 PM, Massimiliano wrote:
>
> I have read it. And i was serching where he is talking about this, but I
> can't find!!!
> I'm searching again!
>
> Thanks
>
> Massimiliano
>
> 2010/6/2 Robert Kluin <[email protected]>
>
>> I suggest you have a look an introductory programming resouce. For
>> starters, see the python getting started guide:
>> http://www.python.org/about/gettingstarted/
>>
>>
>> Robert
>>
>>
>> On Jun 2, 2010, at 11:40, Massimiliano <[email protected]>
>> wrote:
>>
>> In my file I have:
>>
>> food = self.request.get('food')
>> field = self.request.get('field')
>> lista = db.Query(FOOD).filter(field, food).order('-Date').fetch(limit=30)
>>
>> I need field to be "*Myfieldvar="*
>> *
>> *
>> How can I do this?
>>
>> Max
>>
>> 2010/6/2 Robert Kluin <[email protected]>
>>
>>> As the page you link to says, it takes a string as the first argument --
>>> so, yes. It can take a variable.
>>>
>>> myvar = "prop >"
>>> Kind.all().filter(myvar, 5)
>>>
>>>
>>> Robert
>>>
>>>
>>>
>>> On Jun 2, 2010, at 3:39, Massimiliano <[email protected]>
>>> wrote:
>>>
>>> Dear All,
>>> in filter(property_operator, value) could the property_operator be a
>>> var?
>>> Could you please tell me how it must be done?
>>> <http://code.google.com/intl/it-IT/appengine/docs/python/datastore/queryclass.html#Query_filter>
>>> http://code.google.com/intl/it-IT/appengine/docs/python/datastore/queryclass.html#Query_filter
>>> I can't find more details.
>>>
>>> Regards
>>>
>>> Massimiliano
>>>
>>> --
>>>
>>> My email: <[email protected]>
>>> [email protected]
>>> My Google Wave: <[email protected]>
>>> [email protected]
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Google App Engine" 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/google-appengine?hl=en.
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Google App Engine" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected]<google-appengine%[email protected]>
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/google-appengine?hl=en.
>>>
>>
>>
>>
>> --
>>
>> My email: [email protected]
>> My Google Wave: [email protected]
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]<google-appengine%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine?hl=en.
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]<google-appengine%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine?hl=en.
>>
>
>
>
> --
>
> My email: [email protected]
> My Google Wave: [email protected]
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" 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/google-appengine?hl=en.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-appengine%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>
--
My email: [email protected]
My Google Wave: [email protected]
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" 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/google-appengine?hl=en.