You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently, I tried using the eve to design a CMDB system, a situation happened.
In Schema Definition,I'd like to use custom datasource and { "versioning": True, } at the same time, when i PATCH a document, the behind Traceback happened.
[2020-11-25 17:46:42,772] ERROR in patch: 'resource_APP_versions'
Traceback (most recent call last):
File "/Users/abin/code/Lipotes/micro-api/.env3.6/lib/python3.6/site-packages/eve/methods/patch.py", line 239, in patch_internal
insert_versioning_documents(resource, updated)
File "/Users/abin/code/Lipotes/micro-api/.env3.6/lib/python3.6/site-packages/eve/versioning.py", line 159, in insert_versioning_documents
app.data.insert(versionable_resource_name, versioned_documents)
File "/Users/abin/code/Lipotes/micro-api/.env3.6/lib/python3.6/site-packages/eve/io/mongo/mongo.py", line 460, in insert
datasource, _, _, _ =self._datasource_ex(resource)
File "/Users/abin/code/Lipotes/micro-api/.env3.6/lib/python3.6/site-packages/eve/io/base.py", line 424, in _datasource_ex
datasource, filter_, projection_, sort_ =self.datasource(resource)
File "/Users/abin/code/Lipotes/micro-api/.env3.6/lib/python3.6/site-packages/eve/io/base.py", line 359, in datasource
dsource = config.SOURCES[resource]
KeyError: 'resource_APP_versions'
In debugging mode, I have tried the next code, and it will successfully get dsource. and following,the versioned document will inserted to a collection named 'resource_APP_versions', which is the Expected Behavior.
dsource=config.SOURCES['APP_versions']
thanks!
Environment
Python version:3.6.6
Eve version:1.1.4
MacOS 10.15.7
The text was updated successfully, but these errors were encountered:
Hi,
Recently, I tried using the eve to design a CMDB system, a situation happened.
In Schema Definition,I'd like to use custom datasource and { "versioning": True, } at the same time, when i PATCH a document, the behind Traceback happened.
Some part of my Schema Definition
Expected Behavior
PATCH document and versioned document will inserted to the next two mongo collections separately.
example:
some code in app.py:
event_hook.py:
Actual Behavior
In debugging mode, I have tried the next code, and it will successfully get dsource. and following,the versioned document will inserted to a collection named 'resource_APP_versions', which is the Expected Behavior.
thanks!
Environment
The text was updated successfully, but these errors were encountered: