Commit Graph

768 Commits

Author SHA1 Message Date
Malcolm Tredinnick 5da47e43c7 Fixed #7314 -- Changed the way extra() bits are handled when QuerySets are merged.
Also added a section to the documentation to indicate why it's probably not a
good idea to rely on this feature for complex stuff. Garbage in, garbage out
applies even to Django code.

Thanks to erik for the test case for this one.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7791 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-30 06:24:21 +00:00
Malcolm Tredinnick b0bc8b9dfd Fixed #7565 -- Fixed a problem with PostgreSQL sequence resetting in loaddata.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7789 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-30 00:38:14 +00:00
Malcolm Tredinnick 18d89cc1f7 Fixed #7323 -- Fixed a count() edge-case.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7787 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-29 11:50:04 +00:00
Malcolm Tredinnick 050d0a1b75 Fixed #7371 -- Fixed an edge case when ordering on related models.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7786 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-29 11:15:48 +00:00
Malcolm Tredinnick c17e326585 Fixed #7378 -- Use the "to_field" where appropriate on reverse relations.
Patch from mturtle@gmail.com. The remaining uses of "%s__pk" in
fields/related.py all look safe, since they are for many-to-many fields, which
doesn't take "to_field" as a parameter.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7785 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-29 10:35:35 +00:00
Malcolm Tredinnick 4931639636 Fixed #7276 -- Delete multi-table objects correctly.
When model inheritance is used, the parent objects should be deleted as part of
the delete() call on the child.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7784 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-29 09:41:35 +00:00
Malcolm Tredinnick 2c1d6a80b3 Removed a stray debugging print that slipped in.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7783 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-29 09:40:48 +00:00
Malcolm Tredinnick a8fa3fd81f Fixed #7246 -- Pull in the all the necessary data when using select_related() with multi-table inheritance.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7781 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-29 09:39:32 +00:00
Malcolm Tredinnick b67164fb59 Use create() to create objects in the query regression tests, like all the Cool
Kids are doing these days.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7780 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-29 03:07:45 +00:00
Malcolm Tredinnick 6d79ecc8b1 Added a test to show that #7227 was also fixed by [7778].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7779 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-29 03:01:46 +00:00
Malcolm Tredinnick bb2182453b Fixed handling of multiple fields in a model pointing to the same related model.
Thanks to ElliotM, mk and oyvind for some excellent test cases for this. Fixed #7110, #7125.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7778 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-29 02:36:18 +00:00
Malcolm Tredinnick be6ff148c1 Fixed the fix from [7775].
The previous change was failing Django's "check for well-formed domain name"
validation, rather than failing on the network side. Providing we don't ever
set up www.broken.djangoproject.com as a valid domain name, this change should
let us control our own destiny.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7776 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-28 10:55:26 +00:00
Adrian Holovaty 40d2b419ab Fixed #7559 -- Updated newforms unit tests to reflect the fact that http://www.jfoiwjfoi23jfoijoaijfoiwjofiwjefewl.com is no longer a valid domain name
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7775 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-27 21:47:58 +00:00
Malcolm Tredinnick ade4a1246c Reorganised the internals of the Where node a bit to fix some copying problems.
We no longer store any reference to Django field instances or models in the
Where node. This should improve cloning speed, fix some pickling difficulties,
reduce memory usage and remove some infinite loop possibilities in odd cases.
Slightly backwards incompatible if you're writing custom filters. See the
BackwardsIncompatibleChanges wiki page for details.

Fixed #7128, #7204, #7506.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7773 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-27 03:27:20 +00:00
Malcolm Tredinnick 9e23c3c5d9 EmptyQuerySet classes can now be merged with normal querysets.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7765 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-26 11:42:12 +00:00
Malcolm Tredinnick 0e692fda9c Fixed the way symmetrical many-to-many relations are recorded in the Options class.
These types of relations don't have reverse accessor names, so that name can be
used by a normal field on the model. Fixed #7107.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7764 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-26 10:50:25 +00:00
Malcolm Tredinnick 279fc8599b Fixed #7105 -- Fixed dates() queries in light of model inheritance.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7763 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-26 07:51:19 +00:00
Malcolm Tredinnick d2ce1df08f Fixed #7215 -- Create correct reverse-relation accessors when using abstract base classes. Patch from Joel Watts.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7762 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-26 07:04:18 +00:00
Malcolm Tredinnick ba015e0a79 Fixed #7181 -- when ordering by a potentially NULL field, use a left-outer join
so that the ordering doesn't accidentally restrict the result set.

(Ironically, one existing test actually showed this problem, but I was too
dumb to notice the result was incorrect.)


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7761 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-26 06:50:22 +00:00
Malcolm Tredinnick e41df5adcc Fixed #7076 -- Include NULL values when excluding non-NULL items.
Based on a patch from emulbreh.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7760 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-26 05:34:26 +00:00
Adrian Holovaty b7fea94096 Fixed #7542 -- Fixed bug in urlize where it was appending 'http://' to the link text. Thanks for the patch and tests, devin
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7755 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-26 05:07:13 +00:00
Adrian Holovaty 74f0408fa2 Fixed #6201 -- Improved the {% cache %} template tag to allow the timeout to be a template variable. Inspired by the patch by zz and edrik
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7754 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-26 04:54:10 +00:00
Adrian Holovaty 5ee4a099f1 Fixed infuriating lack of apostrophe in a comment
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7753 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-26 04:33:18 +00:00
Adrian Holovaty dbde7fc8b0 Fixed #6322 -- Fixed bug in 'ifchanged' template tag where it wasn't resetting itself properly in some cases. Thanks, nedbatchelder
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7752 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-26 04:30:06 +00:00
Adrian Holovaty 65437a95e1 Improved our tests so that they don't raise an error if setuptools isn't installed, hence ridding the test suite of all dependencies. Also updated docs.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7751 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-26 04:25:40 +00:00
Adrian Holovaty 345a096756 Negligible formatting changes to tests/regressiontests/templates/loaders.py
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7750 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-26 04:22:12 +00:00
Malcolm Tredinnick 5dabaf30b6 A forgotten file from [7743] (test the new DictWrapper class).
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7744 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-26 03:16:55 +00:00
Malcolm Tredinnick 915001ad0b Fixed #7109 -- Quote certain values before passing them for substitution in
Field.db_type().

This fixes a problem with using reserved words for field names in Oracle. Only
affects Oracle at the moment, but the same changes could easily be used by
other backends if they are required (requires changing creation.py, only).

This commit also reverts [7501] so that if the fix doesn't work, it will show
up in the tests (and if it does work, the tests will prevent us from breaking
it again).


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7743 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-26 03:11:32 +00:00
Malcolm Tredinnick 588eeb356c Fixed a problem when constructing complex select_related() calls.
Avoids joining with the wrong tables when connecting select_related() tables to
the main query. This also leads to slightly more efficient (meaning less tables
are joined) SQL queries in some other cases, too. Some unnecessary tables are
now trimmed that were not previously.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7741 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-26 01:02:11 +00:00
Malcolm Tredinnick 1834428648 Fixed a problem with values() and values_list() queries and nullable joins.
Previously, if we were querying across a nullable join and then a non-nullable
one, the second join would not be a LEFT OUTER join, which would exclude
certain valid results from the result set.

This is the same problem as [7597] but for values() field specifications, so
this covers the second case where Django adds extra stuff to the select-clause.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7740 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-26 01:01:21 +00:00
Russell Keith-Magee b8f7b39ccc Fixed #7155 -- Corrected DateQuerySet to handle nullable fields. Thanks to fcaprioli@alice.it for the original report and patch, and to Jeremy Dunck for the test case.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7739 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-25 13:38:06 +00:00
Russell Keith-Magee c8d39f15cb Fixed #7521 -- Reverted [7716]. Fixed URLs in test case broke any application that deployed contrib.auth.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7726 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-23 12:17:57 +00:00
Luke Plant b1851cca3e Fixed bug with Model.delete() which did not always delete objects in the right order.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7722 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-21 20:57:05 +00:00
Luke Plant 7c621535a2 Added tests for corner case with deleting where objects are deleted in the wrong order.
These tests currently fail, by design, fix will be committed shortly.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7721 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-21 20:55:17 +00:00
Luke Plant fad8e8f7c2 Added basic tests for auth.views.password_reset
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7716 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-20 17:43:12 +00:00
Russell Keith-Magee 5da67a084a Fixed #7355 -- Modified urlize utility to handle https:// addresses. Thanks for the report and patch, clint.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7701 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-19 12:05:39 +00:00
Jacob Kaplan-Moss 1a75b5a03c Fixed #4860: added 'for' attributes to labels in newforms widgets. Thanks to Ivan Sagalaev and batiste@dosimple.ch for the patches.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7693 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-18 16:33:04 +00:00
Russell Keith-Magee 4317ba5799 Fixed #7318 -- Cleaned up the template inheritance logic, specifically to handle the case where the parent template has no template tags/blocks. Took the opportunity to optimize the logic a little. Thanks to Matthias Kestenholz <mk@spinlock.ch> for the original report and test case.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7688 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-18 12:59:39 +00:00
Adrian Holovaty e073861332 Fixed #6831 -- Reverse URL resolver now replaces backslashes correctly. Thanks, Bastian Kleineidam
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7660 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-16 04:16:21 +00:00
Adrian Holovaty 95fae79120 Fixed #7456 -- Removed check of exact IndexError exception text in a unit test, for Jython compatibility. Thanks, leosoto
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7646 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-16 03:32:02 +00:00
Russell Keith-Magee 57311b5998 Fixed #7256 -- Corrected queryset code to return the correct set of columns when the query has an empty values() clause as well as extra selects from an extra() clause. Thanks to Nicolas Lara for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7636 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-15 06:24:41 +00:00
Russell Keith-Magee b9113ca81f Fixed #7327 -- Added documentation and test case for defining subqueries. Thanks, Sebastian Noack.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7625 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-12 13:19:37 +00:00
Adrian Holovaty 5309e18cbf Fixed #7026 -- Fixed misleading/incorrect exception text when adding to a many-to-many set on an object that doesn't yet have a primary-key value. Thanks for the report, ryan@peaceworks.ca
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7622 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-12 04:13:16 +00:00
Jacob Kaplan-Moss b5f92938ab Fixed #7298: prevent update() on sliced QuerySet since UPDATE doesn't reliably support LIMIT/OFFSET. Thanks, George Vilches.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7601 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-09 16:17:54 +00:00
Russell Keith-Magee 12716794db Fixed #7350, #7202 -- Fixed serialization for multi-model inheritance, which had multiple problems:
* Serializers were including all superclass fields in their output. Now only local fields are included.
 * Implicit OneToOne primary keys were not correctly added to the metamodel, so they were always marked to be serialized, even though they were primary
 * Model saving was too aggressive about creating new parent class instances during deserialization. Raw save on a model now skips saving of the parent class.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7600 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-09 14:03:35 +00:00
Jacob Kaplan-Moss 31d9dc07aa Fixed #7369: fixed a corner-case involving select_related() following non-null FKs after null ones. Thanks, George Vilches
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7597 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-08 18:13:46 +00:00
Russell Keith-Magee 511e01d978 Fixed #4371 -- Improved error checking when loading fixtures. Code now catches explicitly named fixture formats that are not supported (e.g, YAML fixtures if you don't have PyYAML installed), and fixtures that are empty (which can happen due to XML tag errors). Thanks to John Shaffer for the suggestion, and Keith Bussell for his work on the fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7595 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-08 08:21:18 +00:00
Russell Keith-Magee 8a7bbc3c34 Fixed #5836 -- Corrected the logic in the Test Client when an exception raised by a view is caught and re-raised. Thanks for the report, test case, and fix, Chris Wagner.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7583 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-07 06:25:59 +00:00
Russell Keith-Magee 08401959d8 Fixed #7165 -- Added an assertNotContains() method to the test client. Thanks for the suggestion and implementation, J. Pablo Fernandez <pupeno@pupeno.com>.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7578 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-06 13:50:02 +00:00
Russell Keith-Magee 46cd8bb5b6 Fixed #7143 -- Modified the test client to better match (most) real browser behavior when uploading files. Now, only the file name is sent, rather than the full path. Thanks for the report, cpinto.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7577 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-06 13:39:42 +00:00