Re: [google-appengine] Error in documentation at ndb & projection query.

34 views
Skip to first unread message

Amy Unruh

unread,
Aug 15, 2012, 2:59:08 AM8/15/12
to google-a...@googlegroups.com
Lapteuh,

Thanks very much for taking the time to report that issue, and give a corrected version--  we always appreciate that. The fix for this documentation error is already in the works, and should be out with the upcoming release.
Btw, this slightly simpler syntax should also work:
qry = Article.query().fetch(10, projection=[Article.author, Article.tags])

 -Amy


On 15 August 2012 02:54, Lapteuh <lap...@gmail.com> wrote:
I found error in primer at page.

Incorrect version:
qry = Article.query(projection=[Article.author, Article.tags])
articles
= qry.fetch(20)

Correct version of primer
qo = ndb.QueryOptions(projection=['author', 'tags'])
qry
= Article.query()
articles
= qry.fetch(20, options=qo)

Maybe that help someone.
Sorry for my english.

--
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/-/mIYyrcVPATgJ.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.

Lapteuh

unread,
Aug 16, 2012, 4:08:20 AM8/16/12
to google-a...@googlegroups.com, amyu+...@google.com
Amy,

Thanks too, especially for information of additionaly syntax.

среда, 15 августа 2012 г., 12:59:08 UTC+6 пользователь Amy Unruh написал:
Reply all
Reply to author
Forward
0 new messages