我有以下问题:
我想检索一个类别的所有产品
class Category(emodel):
name = db.StringProperty()
class Channel(emodel):
name = db.StringProperty()
category = db.ReferenceProperty(Category,collection_name="cat_set")
class Product(emodel):
name = db.StringProperty()
channel = db.ReferenceProperty(Channel,collection_name="ch_set")
现在我想写一个 gql 查询来检索一个类别的所有结果。例如:
Product.gql("WHERE channel.category == KEY (:1)", category_selected_key)
请记住,每个频道都可以经常更改其类别,所以我想要一些快速的东西以避免额外的 CPU 工作
谢谢