Skip to content
This repository has been archived by the owner on Feb 7, 2019. It is now read-only.

Fix self-referencing many to many query #112

Merged
merged 3 commits into from Jan 6, 2016

Conversation

brki
Copy link
Contributor

@brki brki commented Dec 23, 2015

Added test and adapted code to make the test pass.

This fixes an issue with when querying a self-referencing many-to-many model in Django 1.6 and 1.7.

Django 1.8 was not affected by this problem.

This allows the SelfReferencingManyToManyTest.test_relationship_spanning_query
test to pass; it was previously raising an error.
@brki
Copy link
Contributor Author

brki commented Dec 23, 2015

The failed Travis check was due to me deleting a branch that I had pushed to the wrong repository.

The successful Travis check is what was triggered by the pull request.

In other words, it is safe to merge.

@maennel
Copy link
Contributor

maennel commented Jan 5, 2016

Hey @brki, thanks for this fix! During review I was thinking about whether it would be a good idea to add a sentence or two describing the purpose of VersionedWhereNode.as_sql(). Something like:
This method identifies joined table aliases in order for VersionedExtraWhere.as_sql() to be able to add time-restrictions that are added by CleanerVersion.

maennel added a commit that referenced this pull request Jan 6, 2016
Fix self-referencing many to many query
@maennel maennel merged commit 4eb3563 into swisscom:master Jan 6, 2016
@maennel
Copy link
Contributor

maennel commented Jan 6, 2016

Thanks!!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants