-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor, upgrade get_nested_collection_attributes
1. Upgrade Query to Select 2. Factor out query-building logic. The previous version returned tuples of items OR models (ORM objects), depending on the calling code (several similar data access methods were combined into this one generic method in PR #12056). The Query object would "magically" convert tuples of ORM objects to ORM objects. The new unified Select object does not do that. As as result, with Select, this method would return tuples of items or tuples of models (not models): result1 = session.execute(statement2) result1 == [("element_identifier_0", "element_identifier_1", "extension", "state"), ...] result2 = session.execute(statement2) result2 == [(dataset1,), (dataset2,) ...] Factoring out the query-building logic and having the caller execute it depending on the expected data structure solves this.
- Loading branch information
Showing
2 changed files
with
68 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters