我的设置如下所示,主标识符使用整数类型。在
当我试图使用这个URL:http://xxxxxxx/promotions/1485919019667访问一个条目(它存在于数据库中)时,它返回htp404。在
我想知道是否不可能使用ObjectID以外的类型作为\u id?在
promotions = {
'item_title': 'promotion',
'item_url' : 'regex("[\d]+")',
'item_lookup': True,
'schema': {
'_id': {
'type': 'integer',
'minlength': 13,
'maxlength': 13,
'required': True,
'unique': True
},
'category': {
'type': 'string',
'allowed': ["MARKETPLACE", "ELAUGETS", "FASHNESS", "FRINKS", "TRENTER", "OTHERS"]
},
'card_id': {
'type': 'string',
'minlength': 1,
'maxlength': 50
},
'title': {
'type': 'string',
'minlength': 5,
'maxlength': 200,
'required': True
},
'description': {
'type': 'string',
'minlength': 5,
'maxlength': 2500,
'required': True
}
}
}
你看过文档中的Handling custom ID fields了吗?引用该页标题:
本教程涵盖了
UUID
字段,但对任何自定义类型都很有用。在相关问题 更多 >
编程相关推荐