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
最后一个语句(book.author.name
)会导致另一个数据存储读取吗?
答案 0 :(得分:2)
是
如果你刚刚开始考虑使用ndb,它已经内置了get请求的缓存。