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

Fixed #21554 - Properly look up which table columns are on during multiple inheritance #2034

Closed
wants to merge 2 commits into from

Conversation

pegler
Copy link
Contributor

@pegler pegler commented Dec 5, 2013

if target_model is not None:
ancestor_link = target_model._meta.get_ancestor_link(model)
if ancestor_link:
column = ancestor_link.column
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could retrieve target_model while avoiding creating a an unnecessary list and dict.

for seen_model, seen_alias in seen_models.items():
    if seen_model and seen_alias == alias:
        ancestor_link = seen_model._meta.get_ancestor_link(model)
        if ancestor_link:
            column = ancestor_link.column
        break

@charettes
Copy link
Member

Thanks for your contribution; manually merged in 38e24d6.

@charettes charettes closed this Dec 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants