Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nesting and indexation improvements #63

Merged
merged 5 commits into from
Aug 29, 2015

Conversation

postatum
Copy link
Member

  • BaseMixin.to_dict now supports __depth param which is used to specify nesting depth.
  • BaseMixin.get_related_documents also processes fields which hold collections of objects.
  • BaseMixin.get_related_documents has new param nested_only. When True, return results only contain data for models on which current model and field are nested.
  • BaseMixin.get_related_documents second item in yielded results must be list of DB objects and not dicts.

This is done by reworking `BaseMixin.get_related_documents`
method to:
* Fetch related objects from instance instead of querying db;
* Return attributes which hold collections of objects instead of
  only returning single item attributes;
@jstoiko jstoiko merged commit 9dbbd53 into ramses-tech:develop Aug 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants