Google App Engine Datastore query problem -
I have the following problem:
I want to retrieve all the products in a category
Now I would like to write a GCL query which omits all refraction For the example category:
Product.gql (" WHERE channel.category == Key (: 1) ", category_selected_key)
Keep in mind that each channel can often change its range, so I want to avoid something extra for the CPU
You can not query 'nested' with GQ Where you filter property of referenced entity such as SQL (using any included).
Because in your reference, the product unit only stores the key of the referenced channel unit, which you must first do another query in order to obtain the key of the square trying to retrieve it:
>
selected_channel = Channel.gql ("WHERE category =: 1", category_selected_key) .get () category_products = Product.gql ("where channel =: 1", selected_channel) .fetch ()
Comments
Post a Comment