Malcolm Tredinnick
f74464da52
queryset-refactor: Fixed values(...).select_related(...) bug that was
...
introduced in [6512]. The lookup tests picked this up.
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6517 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-15 03:31:37 +00:00
Malcolm Tredinnick
70d5e32e13
queryset-refactor: Made the use of values() for ForeignKey fields consistent
...
and documented this feature. Refs #4358 .
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6516 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-15 02:54:30 +00:00
Malcolm Tredinnick
4c4341f012
queryset-refactor: Made sure the ordering columns in a distinct() query only
...
include the columns we are selecting on. This avoids some PostgreSQL problems
and leads to more efficient queries to boot. Refs #5321 .
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6515 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-15 01:20:10 +00:00
Malcolm Tredinnick
e9364c06d6
queryset-refactor: Added a test to show that #3037 is really fixed. Refs #3037 .
...
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6514 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-15 00:48:40 +00:00
Malcolm Tredinnick
e4d1a9aabb
queryset-refactor: Updated documentation to describe the new order_by() and
...
extra(order_by=...) behaviour.
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6513 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-15 00:30:05 +00:00
Malcolm Tredinnick
05ebc901fe
queryset-refactor: Fixed a couple of typos that were messing up extra(select=...).
...
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6512 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-15 00:29:55 +00:00
Malcolm Tredinnick
201c15dcb6
queryset-refactor: Added an order_by parameter to extra(). Refs #2076 .
...
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6511 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-15 00:29:27 +00:00
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
91e8062ff5
queryset-refactor: Removed Options.get_order_sql(). It has no role to play any
...
longer.
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6502 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-14 03:46:07 +00:00
Malcolm Tredinnick
d219428b7c
queryset-refactor: Removed a whole bunch of unused code. This includes the
...
final remnants of handle_legacy_orderlist(). Refs #245 .
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6501 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-14 03:45:53 +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
bd2dfdf989
queryset-refactor: Fixed a problem with count() queries -- we were creating an
...
"ORDER BY" clause sometimes and that isn't accepted by PostgreSQL (and a waste
of time on other databases as well).
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6499 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-14 02:17:12 +00:00
Malcolm Tredinnick
90f2893aea
queryset-refactor: Fixed some quoting problems with aliases.
...
These showed up for PostgreSQL, but this approach is a bit more robust in
general, I suspect.
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6498 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-14 02:16:57 +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
cae24af822
queryset-refactor: Previous exclude() fixing broke the simple case. Fixed that
...
(the lookup tests picked this up).
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6496 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-14 02:16:08 +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
fdb3209062
queryset-refactor: Fixed a bug in Node.negate() for already negated nodes.
...
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6493 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-14 02:15:03 +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
b47231ee3e
querset-refactor: Fixed a bunch of little things as a result of working on the
...
tests.
All of modeltests/ now pass. This includes a fix to modeltests/signals/ (in the
post_delete signal testing), which I'm sure was incorrect previously.
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6489 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-14 02:13:51 +00:00
Malcolm Tredinnick
e9f1f50461
queryset-refactor: Re-added a docs change that was accidentally lost in the merge in [6466].
...
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6488 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-14 02:13:13 +00:00
Malcolm Tredinnick
72f9b7d4e8
queryset-refactor: integrate select_related() into SQL generation.
...
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6487 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-14 02:13:04 +00:00
Malcolm Tredinnick
988b3bbdcb
queryset-refactor: Ported DateQuerySet and ValueQuerySet over and fixed most of
...
the related tests.
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6486 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-14 02:12:40 +00:00
Malcolm Tredinnick
bcdedbbf08
queryset-refactor: Fixed small deepcopy bug in Where clauses.
...
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6485 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-14 02:12:03 +00:00
Malcolm Tredinnick
dfe7e4e925
queryset-refactor: Fixed a bug in QuerySet.get(). Also removed unneeded code form EmptyQuerySet.
...
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6484 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-14 02:11:47 +00:00
Malcolm Tredinnick
7ebf3068c1
queryset-refactor: Merged changed from trunk up to [6463].
...
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6466 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-08 16:10:39 +00:00
Adrian Holovaty
94c320d8a9
queryset-refactor: Merged to [6381]
...
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6382 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-20 01:55:53 +00:00
Adrian Holovaty
28a4aa6f49
queryset-refactor: Merged to [6340]
...
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6341 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15 22:00:35 +00:00
Adrian Holovaty
ca33d307de
queryset-refactor: Merged to [6300]
...
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6340 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15 21:57:25 +00:00
Adrian Holovaty
7325fbf4ff
queryset-refactor: Merged to [6250]
...
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6339 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15 21:46:18 +00:00
Adrian Holovaty
5ce2e6c2c8
queryset-refactor: Merged to [6220]
...
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6337 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15 21:42:51 +00:00
Adrian Holovaty
ea9cd54213
queryset-refactor: Merged to [6198]
...
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6336 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15 21:39:05 +00:00
Adrian Holovaty
d29c457ad1
queryset-refactor: Merged to [6197]
...
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6335 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15 21:35:33 +00:00
Adrian Holovaty
bf6a46d8ad
queryset-refactor: Merged to [6190]
...
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6334 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15 21:34:09 +00:00
Adrian Holovaty
fb6a0c8ffa
queryset-refactor: Merged to [6155]
...
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6332 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15 21:21:37 +00:00
Adrian Holovaty
c8f6e485b8
queryset-refactor: Merged to [6140]
...
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6331 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15 21:18:17 +00:00
Adrian Holovaty
a882e6076b
queryset-refactor: Merged to [6130]
...
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6330 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15 21:15:56 +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
184a6435cd
Fixed deleting via generic relations.
...
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6120 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-13 03:54:47 +00:00
Malcolm Tredinnick
bb77006ade
Use the correct column in custom column handling.
...
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6119 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-13 03:17:46 +00:00
Malcolm Tredinnick
a7d01ec9b4
Fixed limit/offset computations.
...
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6118 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-13 03:11:44 +00:00
Malcolm Tredinnick
cc9d519424
Added missing file.
...
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6117 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-13 02:56:31 +00:00
Malcolm Tredinnick
a7a517f329
Initial portion of queryset rewrite. This breaks a lot more than it fixes in
...
the current state. Committing so that Adrian and I can work on it together.
Do not try to use this yet!
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6116 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-13 02:50:14 +00:00
Malcolm Tredinnick
b791612779
Created a tree data structure. Might be generically useful. Currently used for
...
constructing queries.
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6115 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-13 02:48:46 +00:00
Malcolm Tredinnick
4751fd9ba7
Added a note about not using 'pk' as a field name for a non-primary-key field.
...
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6114 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-13 02:48:06 +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