1
0
mirror of https://github.com/django/django.git synced 2025-07-05 18:29:11 +00:00

4055 Commits

Author SHA1 Message Date
Malcolm Tredinnick
3d07f94d68 queryset-refactor: Merged from trunk up to [6689].
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6690 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-18 05:48:24 +00:00
Malcolm Tredinnick
44df4e390f queryset-refactor: Merged from trunk up to [6635].
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6638 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-03 02:16:27 +00:00
Malcolm Tredinnick
f189280eb3 queryset-refactor: Merged from trunk up to [6623].
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6637 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-03 02:15:27 +00:00
Malcolm Tredinnick
f951d97d99 queryset-refactor: Added the ability to apply parameters to the select
fragments in QuerySet.extra(). Refs #2902


git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6603 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-24 04:22:23 +00:00
Malcolm Tredinnick
abcb70e524 queryset-refactor: Added a convenience all() method to Querysets. Refs #3739
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6600 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-23 13:49:07 +00:00
Malcolm Tredinnick
3940277792 queryset-refactor: Fixed an order_by() regression. It must override any
existing ordering, not append to it.


git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6599 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-23 13:34:03 +00:00
Malcolm Tredinnick
5e1a54a3a8 queryset-refactor: Merged from trunk up to [6595].
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6597 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-23 12:51:22 +00:00
Malcolm Tredinnick
1e1230c41c queryset-refactor: Changed post_delete signal behaviour back to match trunk's
version (it wasn't in error after all).


git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6523 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-15 23:01:18 +00:00
Malcolm Tredinnick
91b1369709 queryset-refactor: Fixed a broken select_related test from [6521].
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6522 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-15 06:51:37 +00:00
Malcolm Tredinnick
8c10e0d00e queryset-refactor: Fixed a possibility of shooting oneself in the foot and
creating infinite recursion with select_related(). Refs #3045, #3288.


git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6521 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-15 05:51:19 +00:00
Malcolm Tredinnick
3429fc0ff2 queryset-refactor: Added a bunch of "new in development version" markers for
recent additions.


git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6520 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-15 03:58:20 +00:00
Malcolm Tredinnick
44d51dae68 queryset-refactor: Added a test to show that #5261 is no longer a problem. Refs #5261.
git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6519 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-15 03:47:10 +00:00
Malcolm Tredinnick
a3b22d9db0 queryset-refactor: Added ~ support to Q-objects. Based heavily on a patch from
Collin Grady. Refs #4858.


git-svn-id: http://code.djangoproject.com/svn/django/branches/queryset-refactor@6518 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-15 03:32:11 +00:00
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