I remember get tripped up on that space, boy was that painful. You can also
leave out the = entirely, it is assumed if no operator is given.
Using filter you can use a key object directly, I have no experience with
using a string with filter.
On Wednesday, March 21, 2012 12:57:15 PM UTC, aschmid wrote:
>
> dont know if this is a typo but there is a strict syntax on how to query.
>
> you are missing some spaces in your filter():
>
> d.filter('user =', user_key)
>
> there is a space between property name ane =
>
> On Mar 20, 2012, at 5:26 PM, Mike wrote:
>
> > I am trying to use the filter() method based on a key argument. For
> > example:
> >
> > user_key="agxkZXZ-emFiZXRhLTJyCgsSBFVzZXIYGAw"
> > d=datamodel.Task.all()
> > d.filter("user=",user_key)
> > results=d.fetch(1024)
> > This produces zero results, and its probably because the key isn't in
> > the right format. If this where gql would I have to use the Key()
> > function like this:
> >
> > db.gqlQuery("select * from Task where user=Key(:1)",user_key)
> > However I don't think I can use the Key() function within a filter,
> > but there must be some python functional equivalent... Is there a way
> > to properly format a key to be used within the filter() method?
> >
> > User is defined as:
> > user = db.ReferenceProperty(None)
> >
> > --
> > 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 view this discussion on the web visit
https://groups.google.com/d/msg/google-appengine/-/jBg2CUAV8pQJ.
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.