Commit Graph

1130 Commits

Author SHA1 Message Date
Malcolm Tredinnick f747b61c20 Nested query support.
This extends previous functionality that allowed passing Query objects as the
rvals to filters. You can now pass QuerySets, which requires less poking at
opaque attributes. See the documentation of the "__in" lookup type for the
details.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9701 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-05 11:47:48 +00:00
Malcolm Tredinnick 062a94ef45 Reconciling where- and having-clause behaviour.
Extricated the code that works directly with SQL columns (standard
"where" stuff) from the the code that takes SQL fragments and combines
it with lookup types and values. The latter portion is now more
generally reusable. Any existing code that was poking at Query.having
will now break in very visible ways (no subtle miscalculations, which is
a good thing).

This patch, en passant, removes the existing "having" test, since the
new implementation requires more setting up than previously. The
aggregates support (currently in a separate codebase) has tests for this
functionality that work as a replacement for the removed test.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9700 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-05 11:47:14 +00:00
Russell Keith-Magee 096a9ecc5c Fixed #9942 -- Added a to_python handler for FloatField to ensure correct typing of deserialized data before saving. Underlying problem is analogous to #8298, fixed in [8515]. Thanks to David Larlet <larlet@gmail.com> for the report and fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9695 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-03 04:43:58 +00:00
Gary Wilson Jr 9af56803f5 Fixed #8245 -- Added a LOADING flag to autodiscover to prevent an admin.py module with errors from raising a spurious AlreadyRegistered exception in a subsequent call to autodiscover.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9680 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-23 18:25:24 +00:00
Karen Tracey ca33f07e2c Fixed #9865 -- Allow saving of new inline-edited objects with custom non-auto primary key fields that are not the foreign key to the parent object.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9664 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-21 04:56:32 +00:00
Karen Tracey 986e162c5d Follow-up to r9656 -- beef up the added test to exercise all (one can hope) paths through the troublesome get_deleted_objects function and fix the resulting errors.
Refs #9859.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9657 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-16 17:42:18 +00:00
Karen Tracey 10894da8a8 Fixed #9859 -- Added another missing force_unicode needed in admin when running on Python 2.3. Many thanks for report & patch to nfg.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9656 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-16 15:04:47 +00:00
Malcolm Tredinnick fddc0c589e Removed one test that is only intended for PostgreSQL from the visibility of
other databases. This basically hides an annoying warning when running the
tests under MySQL.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9649 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-16 06:42:19 +00:00
Malcolm Tredinnick b96b450981 Fixed #9786 -- Fixed inequality checking for django.db.models.fields.file.FieldFile class.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9647 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-16 04:52:55 +00:00
Malcolm Tredinnick a1cbeb9afb If an SQL query doesn't specify any ordering, avoid the implicit sort
that happens with MySQL when a "GROUP BY" clause is included. This is a
backend-specific operation, so any other databases requiring similar
encouragement can have a function added to their own backend code.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9637 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-10 05:19:27 +00:00
Malcolm Tredinnick 5570b0766d Fixed #9778 -- Added some special casing of the "Join on field 'abc'" error
message. It now gives an extra hint if there's a chance you just made a typo in
the lookup type.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9620 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-09 07:03:52 +00:00
Adrian Holovaty b76d7c1dec Added a 'permanent' argument the simple.redirect_to() generic view. It's True by default, to match existing behavior. If set to False, the redirect will be a 302 instead of a 301. This is technically backwards-incompatible if you were using the redirect_to generic view with a format-string key called 'permanent', which is highly, highly unlikely.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9594 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-08 04:53:34 +00:00
Malcolm Tredinnick 33c0f0de67 This fixes a group of problems in the SQL created by QuerySet.exclude() when
used in a few situations where NULL results can appear.

Fixed #8921 (the only ticket I know of that noticed any of these).


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9590 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-08 02:39:51 +00:00
Malcolm Tredinnick d4f0ae42a2 Fixed #9188 -- Fixed a case where we were generating syntactically invalid SQL in some exclude() queries.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9588 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-07 05:48:01 +00:00
Malcolm Tredinnick bfab9d62ee Added a way to iterate over hidden/visible fields in a form. Useful for manual
form layout.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9569 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-05 04:22:00 +00:00
Ian Kelly 4637a77ff8 Fixed #9706: made SlugField honor max_length in Oracle, matching the other backends.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9548 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-02 18:40:40 +00:00
Russell Keith-Magee 5834b1837f Fixed #9736 -- Added quoting to the SQL constraint names generated during table creation. This is to accommodate primary keys with spaces.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9543 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-02 13:23:29 +00:00
Jacob Kaplan-Moss bd2b0059be Here's the rest of [9530] where I actually rename the tag like I said I did. I swear this was git's fault, not mine.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9532 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-24 22:33:32 +00:00
Jacob Kaplan-Moss 4aa97f5c18 Fixed #6398: added an optional `{% empty %}` clause to the `{% for %}` template tag. The contents of this clause are rendered if the list iterated over turns out to be empty. Thanks, Jannis Leidel.
Astute readers will notice that the patch originally called this `default`; after consideration I decided that `empty` is a very slightly better color for this particular bikeshed.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9530 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-24 22:01:48 +00:00
Jacob Kaplan-Moss 089ab18c02 Fixed #4924: added support for loading compressed fixtures. Thanks to Lars Yencken and Jeremy Dunck.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9527 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-24 20:42:09 +00:00
Karen Tracey 966f652464 Fixed #9615 -- Typo fix to testcase. Thanks jarrow.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9519 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-21 16:54:10 +00:00
Karen Tracey 8e350d036c Fixed #9608: Ensured a Model's default repr() is printable even if its __unicode__ method raises a Unicode error.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9475 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-16 18:58:43 +00:00
Malcolm Tredinnick 1418da7ee4 Fixed #6052 -- Worked around a bug in MySQLdb with regards to handling
SafeUnicode (handle SafeString similarly, just to be safe). Based on a patch
from sfllaw.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9467 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-16 08:50:06 +00:00
Malcolm Tredinnick 9d0bacebd2 Fixed #3501 -- Fixed date filtering in querysets for nullable date fields. Only
affects SQLite.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9466 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-16 08:48:24 +00:00
Brian Rosner f63929dbe2 Fixed #9258 -- Use _default_manager in ForeignKeyRawIdWidget.label_for_value. Thanks nullie for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9444 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-15 02:20:00 +00:00
Malcolm Tredinnick 0349d83289 Fixed #6948 -- The join filter was escaping the literal value that was
passed in for the connector. This was contrary to what the documentation
for autoescaping said and to what every other filter does with literal
strings as arguments.

This is backwards incompatible for the situation of the literal string
containing one of the five special HTML characters: if you were writing
{{ foo|join:"&" }}, you now have to write {{ foo| join:"&amp;" }}.
Previous behaviour was, as noted, a bug and contrary to what was
documented and expected.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9442 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-15 01:16:20 +00:00
Karen Tracey 02e67bba47 Fixed #9592 -- Create data for the generic_inline_admin test during setup instead of via a fixutre since it uses a content type id which will vary depending on what other tests have been run.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9438 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-14 14:47:46 +00:00
Brian Rosner f751d5b713 Fixed #9498 -- Handle a formset correctly when the foreign key is not available (for now).
This case pops up with generic foreign key inlines after [9297]. Added tests
to handle future regressions with generic foreign key inlines in the admin.

Thanks markus and danielr for patches.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9412 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-13 19:03:44 +00:00
Russell Keith-Magee 95d8c0619a Fixed #9351 -- Modified the test client to pass on URL encoded parameters to the underlying views. Thanks to sime for the suggestion.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9398 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-12 11:22:05 +00:00
Karen Tracey cb6a5886f6 Fixed #5079 -- Avoid converting Decimals to floats during save to the database.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9394 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-12 00:35:24 +00:00
Karen Tracey ad4e1a7a72 Add tests mistakenly left out of r9397.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9388 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-10 20:01:51 +00:00
Karen Tracey d82aaef844 Fixed #7064: Made DemicmalField validation support max_digits equal to decimal_places.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9387 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-10 19:52:53 +00:00
Karen Tracey 8cdc53a265 Fixed #6035 -- Gave the SplitDateTimeField the proper default widget. Thanks dtulig.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9385 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-10 19:42:55 +00:00
Karen Tracey 6ed91234e3 Fixed #8910 -- Added force_unicode during admin log message creation to avoid triggering a Python 2.3 bug. Thanks for the report joshg and patch nfg.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9383 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-10 17:13:41 +00:00
Karen Tracey c367e2869e Fixed #9514 -- Made admin change_form template correctly recognize/report when a form has only a single error.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9371 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-09 18:51:28 +00:00
Karen Tracey b81bc22ad2 Fixed #5748 -- Made floatformat filter round properly on all platforms and handle NaN input correctly on Windows. Also added tests for these cases. Thanks for the report and initial patch to SmileyChris and PJCrosier.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9369 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-08 01:44:46 +00:00
Karen Tracey bcd63cbfb0 Fixed #6160, #9111 -- Consistently apply conditional_escape to form errors and labels when outputing them as HTML.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9365 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-06 19:49:24 +00:00
Russell Keith-Magee 7e03244f03 Added new fixture file accidentally left out of [9357].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9358 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-06 11:21:06 +00:00
Russell Keith-Magee b2d2c570b7 Fixed #9011 -- Corrected handling of fixture files that contain errors to correctly report the broken fixture name. Thanks to jlrivitti@gmail.com for the report and initial patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9357 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-06 11:19:13 +00:00
Karen Tracey 21fa517248 Fixed #9218 -- Simplified the fix from #9039 and added tests to ensure this case doesn't break again (and that the simplification didn't break anything).
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9341 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-05 19:47:44 +00:00
Karen Tracey 1515b13d1a Fixed #9418 -- When saving a model form, defer saving of file-type fields until after other fields, so that callable upload_to methods can use data from the other fields. Thanks to Bernd Schlapsi for the report and initial patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9334 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-04 19:48:35 +00:00
Brian Rosner 83af0b8ff3 Fixed #9494 -- Ensure the foreign key in an inline formset is always present on the forms. Thanks Fugazi for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9326 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-01 22:25:41 +00:00
Brian Rosner 0ea15f5650 Fixed #8882 -- When a foreign key is among the unique_together fields in an inline formset properly handle it.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9297 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-31 22:07:05 +00:00
Brian Rosner 524a44e20b Fixed #9462 -- Set the instance in an inline formset correctly so that None does not get passed through to the queryset. Thanks tobias and copelco for the ticket.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9293 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-28 20:01:03 +00:00
Karen Tracey 2026934600 Fixed #8966 -- Changed is_safe for length_is filter to False, since its return value is a boolean, not a string.
Thanks Thomas Steinacher and carljm.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9291 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-28 19:00:49 +00:00
Karen Tracey 34acd39e5d Fixed #9039 take 2 -- Modified the new tests added in [9239] so they pass on Oracle.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9288 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-28 16:19:14 +00:00
Karen Tracey 03070a9955 Fixed #7179 -- Changed breadcrumbs on the add page so that a link to the change view is not included when the user doesn't have permission for that view. Also added tests to ensure the link is not there when it shouldn't be, and there when it should be. Thanks for the report & patch alen__ribic.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9276 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-24 19:14:24 +00:00
Malcolm Tredinnick 3b5d975ff6 Fixed #9411 -- Changed the test from r9081 to be more robust across different database backends.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9254 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-24 06:24:04 +00:00
Malcolm Tredinnick 9319dc496c Fixed #9406 -- Ensure that each database column is only represented once in the
"ORDER BY" clause of an SQL statement.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9251 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-24 06:09:47 +00:00
Malcolm Tredinnick e3aa9a2828 Fixed #9383 -- Don't open a network connection for sending email if there's
nothing to send. Saves a bit of time when, for example, processing 500-error
emails with no ADMINs configured. Based on a patch from Jesse Young.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9248 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-24 04:38:43 +00:00