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

Feature - Nested FilteredRelation Support #1

Open
wants to merge 34 commits into
base: master
Choose a base branch
from

Conversation

ferrants
Copy link

@ferrants ferrants commented Jan 6, 2020

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.

# 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())
Copy link
Author

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

filtered_relation_path, field, _, _ = self.names_to_path(
parts, opts, allow_many, fail_on_missing
)
path.extend(filtered_relation_path[:-1])
Copy link
Author

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 ferrants changed the title [WIP] fix nested filtered relations Feature - Nested FilteredRelation Support Jan 9, 2020
myusko and others added 26 commits January 9, 2020 07:54
…following union(), intersection(), and difference().
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]>
…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.
…copy.

Thanks Simon Charette and Tim Graham for the initial patch.
felixxm and others added 6 commits January 16, 2020 08:06
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.
Thanks dbxnr for the initial patch.

Regression in 6f44f71.
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.