端点proto数据存储区:查询结构化属性

时间:2015-03-03 14:02:25

标签: python google-cloud-datastore google-cloud-endpoints app-engine-ndb endpoints-proto-datastore

我正在尝试实施基于实体的街道的搜索。像这样;

尝试:

class Address(EndpointsModel):
    street = ndb.StringProperty()

class Node(EndpointsModel):
    address = ndb.StructuredProperty(Address)

@Node.query_method(
    path='whatever',
    name='WhatEver',
    query_fields=('address',)
)
def nodes_by_street(self , query):
    return query

得到:

TypeError: Tried to use a ProtoRPC message field: MessageField. Only simple fields can be used when allow message fields is turned off.

我尝试将allow_message_fields添加到query_method,但它无效。

我尝试将address更改为address.street它无效。

我应该怎么做才能让它发挥作用?

0 个答案:

没有答案