embedded table: use DOMAIN to look up the resource fields #47
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch resolve two issues:
another relation, even if the name doesn't match. For example,
product_stable and product_devel are two one-to-one field with a
relationship to product
eve.utils.embedded_document() decide what field should be import in
the embedded resource. Previously, all the fields of the embedded
resource were imported, with the thread of potential endless loops.
For example, a any-to-one relation called
foowith an associate tobarthat we pull with embedded.barhas got afoo_collectionwith a link tofoo. Previously, thefoo_collectionfiled was automatically added in the list of field ofbar.This was enough to create a resource loop in
lookup_foreign_resource.resolve itself embedded resource that were already pulled by
eve_sqlalchemy.utils.sqla_object_to_dict(). Because of that, all the
embedd resources were prefixed with a ID_FIELD in the final JSON.
We now only retrieve the ID_FIELD value, as expected by
embedded_document()
the use of sub-embedded document