我正在尝试实施基于实体的街道的搜索。像这样;
尝试:
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
它无效。
我应该怎么做才能让它发挥作用?