fetch() returns a list with entities, get() returns the first entity found by
the query.
On Jan 19, 2012, at 4:40 PM, thstart wrote:
> I am fetching one record's key like this.
> The result I got in 'profile' is a list containing
> one entity. I was expecting the result the be an entity,
> not a one item list.
> =======================================================================
> key = google_db.GqlQuery('SELECT __key__ FROM LMN WHERE n_name = :1',
> n_name).fetch(1)
> profile = db.get(key)
>
> =======================================================================
>
> To get the entity I have to do this:
>
> profile=profile[0]
>
>
> What is wrong?
>
>
>
> --
> 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/-/gqMr673YCT8J.
> 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].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.