Please sign in to comment.
Fixed #19385 -- Introduced multicolumn joins to the ORM
This patch consist of two main parts. The first part deals with adding RelatedField and ForeignObject fields and basing current relation fields on those. The second part deals with altering the ORM to be able to handle multicolumn joins. There is still a lot of work to be done for full multicolumn ForeignKey support. The ForeignObject based fields do not integrate to other parts of Django (admin, ModelForms, ...). There is no support for multicolumn primary keys or any public way to use multicolumn ForeignKeys. Even with these limitations the ForeignObject based fields allows implementing some interesting constructs, for examples see the added tests in tests/foreign_object/tests.py). The downside of using ForeignObject is that it is private API and should remain so until full virtual field support is implemented. Changes are expected. The patch was written by Jeremy Tillman with some final polish by committer. A very big thank you for the work done!
- Loading branch information...
Showing with 988 additions and 338 deletions.
- +20 −10 django/contrib/contenttypes/generic.py
- +10 −2 django/core/management/validation.py
- +6 −0 django/db/backends/mysql/compiler.py
- +1 −1 django/db/models/__init__.py
- +11 −8 django/db/models/base.py
- +268 −198 django/db/models/fields/related.py
- +31 −2 django/db/models/options.py
- +8 −8 django/db/models/query.py
- +1 −1 django/db/models/related.py
- +60 −37 django/db/models/sql/compiler.py
- +1 −1 django/db/models/sql/constants.py
- +4 −3 django/db/models/sql/expressions.py
- +77 −65 django/db/models/sql/query.py
- +25 −0 django/db/models/sql/where.py
- +2 −2 django/forms/models.py
- 0 tests/foreign_object/__init__.py
- +143 −0 tests/foreign_object/models.py
- +320 −0 tests/foreign_object/tests.py
Oops, something went wrong.