1
0
mirror of https://github.com/django/django.git synced 2025-10-10 15:29:11 +00:00

12 Commits

Author SHA1 Message Date
Malcolm Tredinnick
a1d160e2ea queryset-refactor: Fixed a large bag of order_by() problems.
This also picked up a small bug in some twisted select_related() handling.

Introduces a new syntax for cross-model ordering: foo__bar__baz, using field
names, instead of a strange combination of table names and field names. This
might turn out to be backwards compatible (although the old syntax leads to
bugs and is not to be recommended).

Still to come: fixes for extra() handling, since the new syntax can't handle
that and doc updates.

Things are starting to get a bit slow here, so we might eventually have to
remove ordering by many-many and other multiple-result fields, since they don't
make a lot of sense in any case. For now, it's legal.

Refs #2076, #2874, #3002 (although the admin bit doesn't work yet).


git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6510 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-14 22:38:54 +00:00
Malcolm Tredinnick
6678de130c queryset-refactor: Fixed handling of extra(tables=...). In passing, this solves
a duplicate table / bad SQL problem. Refs #2496.


git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6504 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-14 03:46:44 +00:00
Malcolm Tredinnick
93b4199912 queryset-refactor: Added a test to show we can now query for empty reverse
relationships. Refs #2400.


git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6503 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-14 03:46:20 +00:00
Malcolm Tredinnick
ccc3a4766d queryset-refactor: Removed unneeded import.
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6500 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-14 03:45:34 +00:00
Malcolm Tredinnick
0ebb752e89 queryset-refactor: Made all the changes needed to have count() work properly
with ValuesQuerySet. This is the general case of #2939.

At this point, all the existing tests now pass on the branch (except for
Oracle). It's a bit slower than before, though, and there are still a bunch of known bugs that aren't in the tests (or only exercised for some backends).


git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6497 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-14 02:16:38 +00:00
Malcolm Tredinnick
240ecf0811 queryset-refactor: Fixed the optimization that potentially removes the final
join to handle the case where a to_field attribute is given for the join.


git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6495 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-14 02:15:52 +00:00
Malcolm Tredinnick
425e4662a4 queryset-refactor: Fixed the SQL construction when excluding items across
nullable joins. This is #5324 plus a few more complex variations on that theme.


git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6494 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-14 02:15:28 +00:00
Malcolm Tredinnick
142e400c5c queryset-refactor: Create a new join when merging two QuerySets that use a 1-m
field.


git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6492 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-14 02:14:53 +00:00
Malcolm Tredinnick
8926b431ed queryset-refactor: Removed a test that can be better (and simply) fixed on trunk
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6491 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-14 02:14:29 +00:00
Malcolm Tredinnick
2c4013e74f queryset-refactor: Fixed a problem in the isnull=True handling.
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6490 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-14 02:14:15 +00:00
Malcolm Tredinnick
ff3f6df54c Fixed some more join and lookup tests.
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6121 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-13 06:33:41 +00:00
Malcolm Tredinnick
2d07a19c19 Created some tests to show ORM queries that are problematic.
Still incomplete at the moment, but this version doesn't crash the test
framework.


git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6113 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-13 02:47:29 +00:00