forked from django/django
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature - Nested FilteredRelation Support #1
Open
ferrants
wants to merge
34
commits into
master
Choose a base branch
from
filtered-relation-nested
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
ferrants
force-pushed
the
filtered-relation-nested
branch
from
January 8, 2020 23:15
b6a95d8
to
4acc449
Compare
ferrants
commented
Jan 9, 2020
django/db/models/query_utils.py
Outdated
# Add other usable aliases in the query to the reuse set. | ||
# Check for if it can be used is in Query.join | ||
reusable_aliases = self.path | ||
reusable_aliases += list(query.alias_map.keys()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change allows lookups to use relations not in the direct mapping of the FilteredRelation
ferrants
commented
Jan 9, 2020
filtered_relation_path, field, _, _ = self.names_to_path( | ||
parts, opts, allow_many, fail_on_missing | ||
) | ||
path.extend(filtered_relation_path[:-1]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This allows the nested FilterRelation relation_name
ferrants
changed the title
[WIP] fix nested filtered relations
Feature - Nested FilteredRelation Support
Jan 9, 2020
…following union(), intersection(), and difference().
Co-authored-by: Mariusz Felisiak <[email protected]>
…logging documentation.
Enumeration helpers are callables, so the template system tried to call them with no arguments. Thanks Rupert Baker for helping discover this.
…gs filtering. Thanks to Tim Graham for the original implementation idea. Co-authored-by: Daniel Maxson <[email protected]>
…Filter. Co-authored-by: Ryan Castner <[email protected]>
…min actions' __name__. Thanks Keshav Kumar for the initial patch.
…med group contains only non-string values. Regression in b625195. Thanks Murat Guchetl for the report.
Unused since 8f8c54f.
…copy. Thanks Simon Charette and Tim Graham for the initial patch.
…ected annotation. Regression in 0f843fd.
…herited choices. Regression in 2d38eb0
ferrants
force-pushed
the
filtered-relation-nested
branch
from
January 16, 2020 01:50
06eb337
to
96d1ebb
Compare
We assumed that any OneToOneField's in a child model must be the parent link and raised an error when parent_link=True was not specified. This patch allows to specify multiple OneToOneField's to the parent model. OneToOneField's without a custom related_name will raise fields.E304 and fields.E305 so this should warn users when they try to override the auto-created OneToOneField.
…e Cache-Control directive.
Thanks dbxnr for the initial patch. Regression in 6f44f71.
ferrants
force-pushed
the
filtered-relation-nested
branch
from
January 16, 2020 23:18
2364b17
to
16b08f3
Compare
ferrants
force-pushed
the
filtered-relation-nested
branch
from
January 16, 2020 23:53
51e0a78
to
2f9bde3
Compare
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.
https://code.djangoproject.com/ticket/29789
There are some other places I considered making changes, noted in the comments. I'd remove these comments before wanting to merge, but left them there for conversation sake.