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
Hello. The problem located in MongoEngineResource._wrap_polymorphic method. In place, where resource overrides its self._meta.object_class, self._meta.queryset and other "low level" fields.
So if I have polymorphic resource, maybe used in several places, I have chance to get wrong result. (what I saw in my project).
While that fields is overridden in resource class the method _wrap_request is working wrong. I do not look closer but i think because of this lines
if resource._meta.object_class is self._meta.object_class:
return fun()
We entered in "fun()". But in other thread we have finish dehydration, and already returned all that fields back to remembered values in finally section in _wrap_polymorphic method. Dehydration will be wrong in that case. Basically resource will have no additional fields which added by nested mongoengine documents. (I use polymorphic resource for return different documents, derived from one basic mongoengine document... so, when this error happens, i have only root document fields in result).
The text was updated successfully, but these errors were encountered:
Hello. The problem located in MongoEngineResource._wrap_polymorphic method. In place, where resource overrides its self._meta.object_class, self._meta.queryset and other "low level" fields.
So if I have polymorphic resource, maybe used in several places, I have chance to get wrong result. (what I saw in my project).
While that fields is overridden in resource class the method _wrap_request is working wrong. I do not look closer but i think because of this lines
We entered in "fun()". But in other thread we have finish dehydration, and already returned all that fields back to remembered values in finally section in _wrap_polymorphic method. Dehydration will be wrong in that case. Basically resource will have no additional fields which added by nested mongoengine documents. (I use polymorphic resource for return different documents, derived from one basic mongoengine document... so, when this error happens, i have only root document fields in result).
The text was updated successfully, but these errors were encountered: