Add support for a tuple of classes or types in the QueryBuilder.append#1607
Merged
Conversation
added 4 commits
May 29, 2018 18:03
…, lists or sets as classes. This works now only for keyword cls and for the django backend, but the path has been laid out for the rest. Added also a test, that currently fails for types being set to tuples, since this is the next thing to fix
…/lists/set. A bit of code-refactoring was done to make the code a bit easier to read and avoid code-cuplication. This also prompted removing one method from the interface of the QueryBuilder. This issue is probably resolved at this stage, but a few more tests and additional documentation would not hurt
…ends on types, does the correct thing
lekah
approved these changes
May 30, 2018
Codecov Report
@@ Coverage Diff @@
## develop #1607 +/- ##
===========================================
+ Coverage 57.11% 57.17% +0.05%
===========================================
Files 273 273
Lines 33795 33773 -22
===========================================
+ Hits 19302 19309 +7
+ Misses 14493 14464 -29
Continue to review full report at Codecov.
|
sphuber
added a commit
that referenced
this pull request
May 30, 2018
#1607) The `append` method of the `QueryBuilder` now accepts a tuple, list or set of orm classes for the `cls` and `type` keyword argument, with the one restriction that all classes share a common base class. This allows the user to append a join for a set of classes with the same projection and filtering rules
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #1398
The current implementation of
QueryBuilder.appendonly allows to add a single orm class through theclsortypeargument, however, often one would want to add a tuple of classes, provided they share a common base class. This pull request implements this functionality