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

Removed included from _get_collection_helper() #560

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions flask_restless/views/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1772,19 +1772,22 @@ def _get_collection_helper(self, resource=None, relation_name=None,
instances = resource
else:
instances = search_items
# Resolves issue #558 - This is performing a full table scan so
# break out the nuns because this is misbehaving.
#
# Include any requested resources in a compound document.
try:
included = self.get_all_inclusions(instances)
except MultipleExceptions as e:
# By the way we defined `get_all_inclusions()`, we are
# guaranteed that each of the underlying exceptions is a
# `SerializationException`. Thus we can use
# `errors_from_serialization_exception()`.
return errors_from_serialization_exceptions(e.exceptions,
included=True)
if 'included' not in result:
result['included'] = []
result['included'].extend(included)
# try:
# included = self.get_all_inclusions(instances)
# except MultipleExceptions as e:
# # By the way we defined `get_all_inclusions()`, we are
# # guaranteed that each of the underlying exceptions is a
# # `SerializationException`. Thus we can use
# # `errors_from_serialization_exception()`.
# return errors_from_serialization_exceptions(e.exceptions,
# included=True)
# if 'included' not in result:
# result['included'] = []
# result['included'].extend(included)

# This method could have been called on either a request to
# fetch a collection of resources or a to-many relation.
Expand Down