cerberus.schema.SchemaError:{'uuid':[{'query_objectid_as_string':['未知规则']}]}]

问题描述 投票:1回答:1

Eve API。我需要按where = {“ uuid”:“ my_uuid”}] >>过滤记录。因此,我的Eve应用程序的“ settings.py”包含:

'schema': {
        'uuid': {
             'type': 'string',
             'required': True,
             'query_objectid_as_string': True,
             'data_relation': {
                 'resource': 'users',
                 'field': 'uuid',
                 'embeddable': True
             }
         }
    }

[当我尝试通过API调用编写内容时,出现错误:

cerberus.schema.SchemaError: {'uuid': [{'query_objectid_as_string': ['unknown rule']}]}

Python3.6,Eve 1.1,Cerberus 1.3.2

我做错了什么?

Eve API。我需要按where = {“ uuid”:“ my_uuid”}过滤记录。因此,我在Eve应用程序的“ settings.py”包含:'schema':{'uuid':{'type':'string','...

python eve cerberus
1个回答
0
投票

Eve的query_objectid_as_string是资源自定义的一部分。您需要将其从架构配置移动到域配置。有关更多信息,请参阅文档:

© www.soinside.com 2019 - 2024. All rights reserved.