I am new to Google App Engine, and am going through the “Getting Started” tutorial for Python 2.7. I am at the “Using the Datastore” section and am looking at the following GQL query:
greetings = db.GqlQuery("SELECT * "
"FROM Greeting "
"WHERE ANCESTOR IS :1 "
"ORDER BY date DESC LIMIT 10",
guestbook_key(guestbook_name))
I do not understand what WHERE ANCESTOR IS :1 means. I have seen this question: In a GQL query what ANCESTOR IS :1 exactly means? but I do not understand the answer. I have some familiarity with SQL, and I assume that WHERE is some kind of limiting clause on the query. I also understand that objects can have parents, or ancestors. But what does the :1 mean?
It means pass the first parameter (in this case guestbook_key(guestbook_name)) to the query.