Reputation: 1071
class Author (db.Model)
name = db.StringProperty()
class Book (db.Model)
author = db.ReferenceProperty (collection_name="books", indexed=True)
name = db.StringProperty()
author = Author.get (author_key)
q = Book.all()
q.filter ("author =", author.key())
q.filter ("name =", "BOOK_NAME")
book = q.fetch(1)[0]
book.author.name
Will the last statement (book.author.name
) result in a another read on datastore?
Upvotes: 0
Views: 45
Reputation: 12986
Yes
If you are just starting out consider using ndb, which has cacheing of get requests built in.
Upvotes: 2