Commit Graph

955 Commits

Author SHA1 Message Date
Jacob Kaplan-Moss f212b24b64 Cleaned up and refactored `ModelAdmin.formfield_for_dbfield`:
* The new method uses an admin configuration option (`formfield_overrides`); this makes custom admin widgets especially easy.
  * Refactored what was left of `formfield_for_dbfield` into a handful of smaller methods so that it's easier to hook in and return custom fields where needed.
  * These `formfield_for_*` methods now pass around `request` so that you can easily modify fields based on request (as in #3987).

Fixes #8306, #3987, #9148.

Thanks to James Bennet for the original patch; Alex Gaynor and Brian Rosner also contributed.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9760 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-16 15:32:31 +00:00
Malcolm Tredinnick d579e716fe Fixed #9997 -- Fixed use of ValuesQuerySets as rvalues in filters.
Previous behaviour was pretty stupid. Let's never speak of it again. New
behaviour both works and is documented.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9759 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-16 10:59:43 +00:00
Karen Tracey 344f16e220 Fixed #8138 -- Changed django.test.TestCase to rollback tests (when the database supports it) instead of flushing and reloading the database. This can substantially reduce the time it takes to run large test suites.
This change may be slightly backwards incompatible, if existing tests need to test transactional behavior, or if they rely on invalid assumptions or a specific test case ordering.  For the first case, django.test.TransactionTestCase should be used.  TransactionTestCase is also a quick fix to get around test case errors revealed by the new rollback approach, but a better long-term fix is to correct the test case.  See the testing doc for full details.

Many thanks to:
* Marc Remolt for the initial proposal and implementation.
* Luke Plant for initial testing and improving the implementation.
* Ramiro Morales for feedback and help with tracking down a mysterious PostgreSQL issue.
* Eric Holscher for feedback regarding the effect of the change on the Ellington testsuite.
* Russell Keith-Magee for guidance and feedback from beginning to end.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9756 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-16 02:30:22 +00:00
Russell Keith-Magee cc4e4d9aee Fixed #3566 -- Added support for aggregation to the ORM. See the documentation for details on usage.
Many thanks to:
 * Nicolas Lara, who worked on this feature during the 2008 Google Summer of Code.
 * Alex Gaynor for his help debugging and fixing a number of issues.
 * Justin Bronn for his help integrating with contrib.gis.
 * Karen Tracey for her help with cross-platform testing.
 * Ian Kelly for his help testing and fixing Oracle support.
 * Malcolm Tredinnick for his invaluable review notes.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9742 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-15 11:06:34 +00:00
Jacob Kaplan-Moss 1f84630c87 Fixed #6470: made the admin use a URL resolver.
This *is* backwards compatible, but `admin.site.root()` has been deprecated. The new style is `('^admin/', include(admin.site.urls))`; users will need to update their code to take advantage of the new customizable admin URLs.

Thanks to Alex Gaynor.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9739 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-14 20:22:25 +00:00
Jacob Kaplan-Moss c01098e9cb In urlconfs, include() may now be used on an iterable of patterns instead of just a module string. Refs #6470 -- making the admin use a urlconf is much easier with this work done. Thanks, Alex Gaynor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9728 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-10 22:54:20 +00:00
Malcolm Tredinnick c5bdfab9ae Fixed #9985 -- qs.values_list(...).values(...) was constructing incorrect SQL.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9717 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-08 05:49:03 +00:00
Malcolm Tredinnick d068ad0c01 Using querysets as an rvalue in filter() calls was causing an unnecessary
database query, due to a bool() call. This change stops that behaviour.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9715 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-08 05:16:21 +00:00
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 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 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 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
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 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 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 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
Karen Tracey 30241385d5 Fixed #9252 -- Moved the try/except protecting against incorrect lookup params to where the error is now raised, and added a test for this case.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9245 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-22 23:09:35 +00:00
Karen Tracey ae43d11838 Fixed #3096 -- Make admin list_filters respect limit_choices_to.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9241 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-21 19:03:21 +00:00
Jacob Kaplan-Moss d7c829c98e Yet more file storage testing cleanup for the sake of buildbots; this should be the last of it, I hope.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9226 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-10 22:13:16 +00:00
Jacob Kaplan-Moss b21ea0a836 More be-nice-to-the-buildbot: be better about cleaning up files created by the cache/session tests.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9224 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-10 21:41:12 +00:00
Ian Kelly 9a72913edd Fixed .distinct() not working with slicing in Oracle, due to the
row numbers necessarily being distinct.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9221 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-10 17:15:58 +00:00
Karen Tracey 05d695908c Fixed #9053 -- Allowed for sorting of callable and ModelAdmin methods specified in list_display (added in r8352). Previously attempting to sort on the former would raise an exception and the latter simply didn't sort. Also added tests for this function. Thanks rgl and jenan.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9211 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-08 14:47:01 +00:00
Malcolm Tredinnick 7e7a370e20 Fixed #9319 -- Fixed a crash when using the same model field in multiple
unique_together constraints.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9208 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-08 10:09:44 +00:00
Malcolm Tredinnick 559aca7d78 A queryset that has had ordering removed (order_by()) can have ordering added
again later (order_by('foo')). Or, at least, it can now. Thanks to Ilya
Novoselov for diagnosing the problem here.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9206 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-08 09:45:27 +00:00
Malcolm Tredinnick 44f228fd61 Fixed #6748 -- When printing the repr() of querysets, don't load or display
more than 20 objects.

This means that accidentally executing HugeStoryArchive.objects.all() at the
interactive prompt (or in the debug template) won't try to load all 4,233,010
stories into memory and print them out. That would previously cause resource
starvation and other "interesting" crashes.

If you really, really want the previous behaviour (e.g. in a doctest that
prints more than 20 items), display "list(qs)" instead of just "qs".


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9202 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-08 08:38:33 +00:00
Malcolm Tredinnick 268ef594ac Applying a limit to a queryset that already had an upper limit of 0 wasn't
working properly.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9201 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-08 08:37:35 +00:00
Malcolm Tredinnick ce770aaecd The tests added in r9184 were altering the test environment in bad ways. Fixed
this with proper setUp() and tearDown() methods.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9200 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-08 08:36:41 +00:00
Malcolm Tredinnick 70b6c4c015 Fixed #9233 -- Allow date and message-id headers to be passed in manually in
email messages. Previously we were creating duplicate headers, which was bad.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9197 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-07 12:20:01 +00:00
Malcolm Tredinnick cd8eeaacf5 Fixed #5888 -- Added methods to the test client to support HEAD, PUT, DELETE
and OPTIONS support. Thanks Scott Barr and Leah Culver.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9188 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-07 09:23:40 +00:00
Malcolm Tredinnick 30b568226f Fixed #9199 -- We were erroneously only prepending "www" to the domain if we
also needed to append a slash (when PREPEND_WWW=True).

Based on a patch and tests from gonz. Thanks.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9184 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-07 08:22:50 +00:00
Malcolm Tredinnick 8fb1459b52 Added some better error reporting and path handling when creating template paths.
We now raise UnicodeDecodeError for non-UTF-8 bytestrings (thanks to Daniel
Pope for diagnosing this was being swallowed by ValueError) and allow UTF-8
bytestrings as template directories.

Refs #8965.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9161 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-06 06:34:54 +00:00
Malcolm Tredinnick 7cec38b076 Fixed #9259 -- Fixed a validation error for Spanish identity card numbers.
Patch from Marc Garcia.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9129 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-05 05:59:04 +00:00
Malcolm Tredinnick 8524089769 Add internationalisation support to the comment templates. Fixed #8868, #8905
Thanks to zgoda for a patch that did most of the internationalisation part.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9119 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-05 05:09:21 +00:00
Malcolm Tredinnick 227a93b64f Fixed #8803 -- Allow authenticated users without first_name/last_name values set to post comments.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9118 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-05 05:07:32 +00:00
Malcolm Tredinnick d343aa3022 Altered a failing url template tag test to work more reliably.
There's no guarantee about the order in which ambiguous patterns are resolved.
The solution is "don't do that" and avoid ambiguity.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9113 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-05 04:59:55 +00:00
Russell Keith-Magee a855755711 Fixed #9293: Corrected expected test output for the admin_scripts tests, following the changes to --verbosity in 9110. Thanks to Alex for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9112 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-04 01:16:30 +00:00
Malcolm Tredinnick 37ee86b7ee Fixed another case of reverse URL resolving that wasn't working.
This is a similar situation to that fixed in r9087. We weren't merging
multiple levels of include() calls together correctly.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9099 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-30 05:52:35 +00:00
Malcolm Tredinnick baa960209f Fixed Queryset.dates() in the presence of extra-select columns.
Any extra(select=...) columns can be ignored in the SQL for dates, since we are
only interested in extracting distinct date values. We were previously
including them by accident and it was generating incorrect SQL.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9091 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-28 04:36:10 +00:00
Malcolm Tredinnick 15b0158e39 Fixed #9038 -- Correctly handle URL patterns with the same name (or view name),
declared independently and that differ only by argument signatures.

Patch from Russell Keith-Magee.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9087 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-27 06:14:11 +00:00
Malcolm Tredinnick 6c7cf34d69 Fixed #9171 -- Fixed a few places where we were assuming lists instead of
generic sequences in ModelForm structures. Patch from mrmachine.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9086 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-27 05:57:10 +00:00
Malcolm Tredinnick 922aba3def Fixed a missing variable initialisation deep in the Query bowels.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9081 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-22 00:31:22 +00:00
Malcolm Tredinnick 9931c9e132 Fixed #9125 -- When displaying errors for a form with only hidden fields, make sure the resulting XHTML is correct.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9067 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-18 07:16:08 +00:00
Malcolm Tredinnick a27ff1c8ae Fixed #8865 -- Improved the robustness of some file path tests.
Based on a patch from pythonhead@gentoo.org.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9065 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-17 09:32:36 +00:00
Adrian Holovaty 8efeaea9dd Fixed #9073 -- Fixed a unit test that broke after [9002]. Thanks, kratorius
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9046 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-16 05:52:29 +00:00
Malcolm Tredinnick e47cc781d8 A bug from queryset-refactor days: although the Query class has "group_by" and
"having" attributes, only the former was included in the resulting SQL, meaning
subclasses had to completely duplicate Query.as_sql() if they were using any
kind of grouping filtering on the results.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9007 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-11 02:00:27 +00:00
Malcolm Tredinnick d88688014f Fixed #7588 -- Inherit fields from concrete ancestor classes via abstract base
classes. Based on a patch from emulbreh.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8932 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-03 18:38:43 +00:00
Malcolm Tredinnick 7bc5db3a88 Changed the tests added in r8898 very slightly so that they don't return
unintended results. Doctests aren't self-contained yet when run as part of
the full suite. Refs #5624, #8835.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8930 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-03 17:59:09 +00:00
Malcolm Tredinnick 780f239fa7 Fixed #8825 -- Fixed a small error model field setup (on the model class) from
r8855. Patch from Christofer Bernander. Test based on one from cgrady.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8908 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-03 05:53:50 +00:00
Malcolm Tredinnick 61cc4a1eee Fixed #8819 -- Don't include two copies of extra-select columns in the query.
This was triggered by r8794, but was, in fact, fairly fragile before then. The
current fix is the correct way we should be doing this.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8898 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-03 03:48:25 +00:00
Jacob Kaplan-Moss 0e5faf225c Security fix. Announcement forthcoming.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8877 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-02 21:10:00 +00:00
Brian Rosner c1de41f4d2 Fixed #7973 -- Added exclude to BaseModelAdmin to make everything consistent with the form/formset factories. Refs #8071 to make it easier to get at exclude. Thanks julien for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8861 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-02 17:26:24 +00:00
Malcolm Tredinnick f31425e8e2 Fixed #7154 -- Inherit all model managers from abstract base classes.
Also added documentation describing how manager inheritance works (and when
manager aren't inherited). Based on some patches from sebastian_noack and
emulbreh.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8851 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-02 09:04:54 +00:00
Brian Rosner 0cd5caa6a8 Fixed #8787 -- Fixed failing admin_widgets tests. This fixes ManyToManyRawIdWidget which was broken with [8823]. Thanks Alex Gaynor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8846 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-02 06:10:14 +00:00
Malcolm Tredinnick 12f6259903 Fixed #8439 -- Complex combinations of Q-objects (using both conjunctions and
disjunctions) were producing incorrect SQL when nullable relations were
involved. This fixes that.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8832 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-02 02:16:41 +00:00
Malcolm Tredinnick a9465a75de Fixed a case of incorrect parsing of quanitifers in reg-exp patterns.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8825 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 23:03:03 +00:00
Brian Rosner ce47d4ab83 Fixed #8648 -- Admin no longer ignores to_field. Thanks for the help Karen Tracey and SmileyChris.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8823 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 22:43:38 +00:00
Jacob Kaplan-Moss fc4948d574 Fixed #8770: made some tests more robust under MySQL. Thanks, Alex Gaynor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8821 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 22:28:18 +00:00
Jacob Kaplan-Moss 3a18002bbd Fixed #8210 and #8664: moved `USStateField` and `PhoneNumberField` to `django.contrib.localflavor.us`. This is a backwards-incompatible change, albeit a minor one; just add an aditional `import` and go on your way.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8819 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 22:15:35 +00:00
Brian Rosner 7c7ad041b3 Fixed #7975 -- Callable defaults in inline model formsets now work correctly. Based on patch from msaelices. Thanks for your hard work msaelices.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8816 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 21:28:32 +00:00
Jacob Kaplan-Moss d5cc16b471 Fixed #8076: fixed `get_(next/previous)_by_date` when used with subclasses. Thanks, bjornkri and jan_oberst.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8814 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 21:04:01 +00:00
Jacob Kaplan-Moss e545058ba9 Fixed #8354: the MySQL backend no longer raises a cryptic error. Instead, it raises a less-cryptic error. Obiously this isn't a perfect solution by any means, but it'll do until we can revisit timezone handling in the future.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8802 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 17:48:39 +00:00
Jacob Kaplan-Moss 15206298ed Revert [8799]. That wasn't ready for prime-time yet -- thanks, git-svn!
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8801 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 17:38:59 +00:00
Jacob Kaplan-Moss 429c87fef8 A failing test for #8354
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8799 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 17:22:34 +00:00
Russell Keith-Magee f55b834c2f Fixed #7302: Corrected quoting of columns in extra_group_by. Thanks to Ivan Sagalaev for the patch and initial test.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8794 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 12:07:26 +00:00
Malcolm Tredinnick 2d7feda05c Fixed #7512 -- Fixed an oversight when I first fixed ordering on nullable
foreign keys (r7761). Thanks to George Vilches for the test case here.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8783 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 02:43:55 +00:00
Malcolm Tredinnick 4480645ac3 Fixed #8316 -- Put tighter restrictions on the type of Foreign Key fields
created for MySQL (because MySQL + InnoDB has those restrictions).
Patch from julianb.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8782 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 00:49:03 +00:00
Malcolm Tredinnick 7838493b9e Fixed #8726 -- When doing reverse URL resolving, make sure we're consistently
dealing with unicode strings throughout by promoting up from UTF-8 as necessary.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8777 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-31 22:47:25 +00:00
Jacob Kaplan-Moss 4ae746b574 Added a `TypedChoiceField` which acts just like `ChoiceField`, except that it
returns a value coerced by some provided function. Refs #6967.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8771 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-31 20:10:50 +00:00
Jacob Kaplan-Moss 86316f0be6 Fixed #7027: template tags now corectly break tokens around strings marked for translation.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8769 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-31 18:28:06 +00:00
Malcolm Tredinnick 6390155f5c Added a couple of extra tests to ensure url tag robustness. These are an
attempt to verify #8726.

Refs #8726.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8766 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-31 17:29:49 +00:00
Malcolm Tredinnick e1ea7014ad Fixed #8725 -- Handle empty URL patterns in reverse().
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8763 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-31 17:20:40 +00:00
Malcolm Tredinnick 24bacb19de Fixed #5216 -- Fixed a case of a string not being a unicode string.
Thanks to Vadim Fint for the test case.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8761 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-31 11:39:06 +00:00
Malcolm Tredinnick a63a83e5d8 A rewrite of the reverse URL parsing: the reverse() call and the "url" template tag.
This is fully backwards compatible, but it fixes a bunch of little bugs. Thanks
to SmileyChris and Ilya Semenov for some early patches in this area that were
incorporated into this change.

Fixed #2977, #4915, #6934, #7206.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8760 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-31 11:11:20 +00:00
Jacob Kaplan-Moss ae72e25b35 Fixed #8716: correctly handle name and email in comments from authenticated users.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8751 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-30 21:30:02 +00:00
Jacob Kaplan-Moss 15644cb255 Fixed #8622: accessing POST after a POST handling exception no longer throws the server into an infinite loop. Thanks to vung for tracking this one down and fixing it.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8748 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-30 19:56:14 +00:00
Jacob Kaplan-Moss f2d7ee759a Fixed #8710: removed a few stray tabs. Thanks, gkelly.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8746 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-30 19:25:40 +00:00
Malcolm Tredinnick fd0cc45828 [8721] introduced some internal field names. We hide them from the list of
valid field names in debugging output so that it doesn't confuse things.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8730 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-30 04:52:56 +00:00
Malcolm Tredinnick 51836756d0 Fixed a typo from the refactoring in [8455]. With bonus test, too. Thanks, vung.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8724 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-29 22:29:38 +00:00
Malcolm Tredinnick f04123f4df Fixed #8279 -- Multiple many-to-many relations to "self" are now possible.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8721 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-29 21:24:00 +00:00
Jacob Kaplan-Moss c068bc184c Merge branch 'url-tag-asvar'
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8716 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-29 19:28:03 +00:00
Jacob Kaplan-Moss 6a8dcafb57 Fixed #8278: fixed `QueryDict.update(QueryDict)`. Thanks, julien.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8705 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-29 16:49:19 +00:00
Brian Rosner cd0b65bcf7 Fixed #7982 -- Corrected ModelAdmin url dispatching to ensure it matching exactly what it needs and doesn't stomp on primary key space. 'add' is a lost cause for now. This originated from #6470. Thanks jdetaeye for the original patch and basith for providing test cases.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8704 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-29 16:46:46 +00:00
Jacob Kaplan-Moss ddf7d7ab02 Fixed #8668: prevent MySQL from running the new test from [8676].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8703 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-29 16:32:44 +00:00
Jacob Kaplan-Moss 21928f2ba0 Fixed #7738: support initial values via `GET` for `SelectMutliple` in the admin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8699 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-29 16:09:29 +00:00
Malcolm Tredinnick 54f41e3507 Fixed #8101 -- Allow the strings '1' and '0' as filter values for boolean
fields (the latter was causing problems). This allows these values in URLs
(e.g. the admin filtering).

Not an ideal solution to the problem, but will do the job for the time being.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8691 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-29 02:40:56 +00:00
Jacob Kaplan-Moss 9f59fc5560 Fixed #8651: correctly deserialize objects with 0 for pk/fk.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8676 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-28 19:38:56 +00:00
Malcolm Tredinnick 65c0846c45 Updated a few save() methods on models to accept force_insert and force_update
parameters. Required as a consequence of [8670] (so they can be used with
create()).


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8673 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-28 19:28:17 +00:00
Jacob Kaplan-Moss b31568aed3 Fixed #8027: correctly validate fields/fieldsets in `ModelAdmin` validation when using custom `ModelForm`s.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8662 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-28 15:43:04 +00:00
Jacob Kaplan-Moss b99cc935eb Fixed #7753: clean `NullBooleanField` correctly when using `HiddenInput`. Thanks to julien and ElliottM.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8661 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-28 15:06:18 +00:00
Malcolm Tredinnick 71dda19184 Fixed #8597 -- Allow the use of strings containing underscores and percentage
signs in "iexact" queries on PostgreSQL again (this case was missed in [8536]).


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8646 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-28 05:42:05 +00:00
Jacob Kaplan-Moss 1abfb1df19 Fixed #8276: corrected another couple of names in localflavor.pl.forms. Patch by Piotr Lewandowski.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8643 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-27 23:05:25 +00:00
Jacob Kaplan-Moss ff420b4364 Fixed #8454: added a FILE_UPLOAD_PERMISSIONS setting to control the permissoin of files uploaded by the built-in file storage system. Thanks, dcwatson.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8640 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-27 22:21:14 +00:00
Jacob Kaplan-Moss 52672f2b94 Fixed #8534: getting the size of a file no longer opens it (at least for the built-in file-system storage). Thanks, snaury.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8638 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-27 21:30:47 +00:00
Jacob Kaplan-Moss 8943a857a7 Fixed #8175: don't open files we're about to close. This was a pesky bug to track down; thanks to charmless for tracking it down.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8637 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-27 21:18:45 +00:00
Jacob Kaplan-Moss c33aeaa082 FIxed #8156: `UploadedFile.__repr__` now returns a string, a good `__repr__` should.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8636 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-27 20:53:02 +00:00
Jacob Kaplan-Moss 2e9a8801d0 Added a test to ensure that strings in RSS are properly escaped. Refs #6533.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8632 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-27 19:52:27 +00:00
Gary Wilson Jr c2ba59fc1d Removed oldforms, validators, and related code:
* Removed `Manipulator`, `AutomaticManipulator`, and related classes.
 * Removed oldforms specific bits from model fields:
   * Removed `validator_list` and `core` arguments from constructors.
   * Removed the methods:
     * `get_manipulator_field_names`
     * `get_manipulator_field_objs`
     * `get_manipulator_fields`
     * `get_manipulator_new_data`
     * `prepare_field_objs_and_params`
     * `get_follow`
   * Renamed `flatten_data` method to `value_to_string` for better alignment with its use by the serialization framework, which was the only remaining code using `flatten_data`.
 * Removed oldforms methods from `django.db.models.Options` class: `get_followed_related_objects`, `get_data_holders`, `get_follow`, and `has_field_type`.
 * Removed oldforms-admin specific options from `django.db.models.fields.related` classes: `num_in_admin`, `min_num_in_admin`, `max_num_in_admin`, `num_extra_on_change`, and `edit_inline`.
 * Serialization framework
   * `Serializer.get_string_value` now calls the model fields' renamed `value_to_string` methods.
   * Removed a special-casing of `models.DateTimeField` in `core.serializers.base.Serializer.get_string_value` that's handled by `django.db.models.fields.DateTimeField.value_to_string`.
 * Removed `django.core.validators`:
   * Moved `ValidationError` exception to `django.core.exceptions`.
   * For the couple places that were using validators, brought over the necessary code to maintain the same functionality.
 * Introduced a SlugField form field for validation and to compliment the SlugField model field (refs #8040).
 * Removed an oldforms-style model creation hack (refs #2160).

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8616 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-27 07:19:44 +00:00
Malcolm Tredinnick 900178d795 Added a test from kcarnold to show that #7498 is fixed. Refs #7498.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8609 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-27 05:44:26 +00:00
Malcolm Tredinnick 255bf69e09 Tweaked the admin validation code to make things a bit easier to read. Tracing
through all the underscore-prefixed and wrapped functions was a bit trying and
some of the names were misleading. No functional changes. Primarily, this is
just bringing the style into line with the rest of the codebase.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8604 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-26 23:06:24 +00:00
Malcolm Tredinnick 1fc8f84f58 Fixed #8566 -- Allow safe-strings in the "attrs" parameter to form widgets.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8601 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-26 21:32:17 +00:00
Jacob Kaplan-Moss 5f396193fb Updated comment tests to hook up URLs in the correct manner. This fixes a bunch of silly test failures.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8600 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-26 21:30:15 +00:00
Malcolm Tredinnick 384c48e456 Cleaned up some tests I broke as a result of the escapejs changes in [8577].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8599 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-26 20:51:45 +00:00
Malcolm Tredinnick 8f5234d801 Fixed #8036 -- Fixed a case when attempting to traverse non-existent related
instances. We weren't skipping the correct output columns before processing
subsequent existing related instances. Thanks to mrmachine for the test case.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8598 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-26 20:44:20 +00:00
Jacob Kaplan-Moss 378f5ddb5a Updated comment signals to provide enough information to actually act on. This was uncovered when working on the documentation, which'll be committed shortly.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8589 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-26 18:53:52 +00:00
Malcolm Tredinnick 3111d7f60b Fixed #7201 -- Fixed the timeuntil filter to work correctly with timezone-aware
times. Patch from Jeremy Carbaugh.

This is backwards incompatible in the sense that previously, if you tried to
compare timezone-aware and timezone-naive values, you got an incorrect result.
Now you get an empty string. So your previously incorrect code returns a
different incorrect result.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8579 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-26 08:08:55 +00:00
Malcolm Tredinnick 8c4a525871 Fixed #7177 -- Added extra robustness to the escapejs filter so that all
invalid characters are correctly escaped. This avoids any chance to inject raw
HTML inside <script> tags. Thanks to Mike Wiacek for the patch and Collin Grady
for the tests.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8577 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-26 07:56:32 +00:00
Malcolm Tredinnick 15ed5e61c9 Hid a few QuerySet regression tests from Python 2.6 due to a bug in the the
Python beta releases. Failures there mean that incorrect code won't raise an
error, but it's otherwise harmless (correct code still runs correctly).

Fixed #7786.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8570 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-26 03:22:44 +00:00
Malcolm Tredinnick 3deff41a32 Fixed #8106 -- Untangled some problems with complex select_related() queries
and models that have multiple paths to them from other models.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8559 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-25 22:43:25 +00:00
Jacob Kaplan-Moss cba91997a2 Refactored Django's comment system.
Much of this work was done by Thejaswi Puthraya as part of Google's Summer of Code project; much thanks to him for the work, and to them for the program.

This is a backwards-incompatible change; see the upgrading guide in docs/ref/contrib/comments/upgrade.txt for instructions if you were using the old comments system.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8557 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-25 22:14:22 +00:00
Malcolm Tredinnick b46e736c9a Because the filter tests take non-zero time to pass, it's possible for one of
the timeuntil tests to fail because the pre-recorded "now" has moved on
sufficiently far from actual "now()". Fixed the one test that was failing for
me (the other timeuntil and timesince tests already have a small buffer built
in to guard against this problem).

The problem was revealed after [8535].


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8556 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-25 20:47:42 +00:00
Jacob Kaplan-Moss 744d882110 Fixed #8425: removed the independant nations of Palau, Marshall Islands, and Micronesia from localflavor's list of US states.
...

Man, commit messages like that are incredibly fun to write.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8550 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-25 19:11:41 +00:00
Jacob Kaplan-Moss cbd574881c Updated `TimeInput` changes from [8491] to allow time widgets to be used with unicode values. Fixes #7499.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8549 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-25 19:09:44 +00:00
Russell Keith-Magee 06d49768bd Fixed #7743: Reverted [8483], which was itself a reversion of [8481], after confirmation from Malcolm. Corrected a long standing mistake in the timesince/timeuntil filters when using a parameter for 'now'. Thanks to Andrew Shearer <ashearerw@shearersoftware.com> for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8535 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-25 12:31:10 +00:00
Malcolm Tredinnick c46bb219bf Fixed #7460 -- Made the "cache" template tag always generate keys that can be
used with the memcache backend (which has the strongest restriction on keys).
Based on a patch from trbs.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8533 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-25 04:52:55 +00:00
Malcolm Tredinnick 62b39322f3 Fixed #7496 -- It's now possible to pickle SortedDicts with pickle protocol 2
(used in caching). Thanks, John Huddleston.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8531 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-25 04:00:15 +00:00
Malcolm Tredinnick d62cfce213 Improved the regression test in [8460] a bit, based on some information from
John Huddleston in #7496.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8530 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-25 03:59:28 +00:00
Malcolm Tredinnick d535edb9da Fixed #8510 -- Allow both strings (mostly for the admin) and integers to be
used in "month" and "day" filters on date/datetime fields. Without this commit,
SQLite behaved inconsistently after [8494].


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8526 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-25 03:17:06 +00:00
Malcolm Tredinnick 6d6fb392b4 Fixed #7195 -- Fixed the validation of MultipleChoice fields so that they can
be populated from request.REQUEST. Based on a patch from Daniel Roseman.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8525 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-25 00:32:32 +00:00
Malcolm Tredinnick fbf09ee11d Added a test to show that [8472] also fixed #8254.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8521 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-24 17:54:51 +00:00
Russell Keith-Magee 11e43883d5 Fixed #8298: Added a to_python method for integer fields. This ensures that the data from deserialized instances is of correct type prior to saving. Thanks to Andrew Badr for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8515 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-24 08:12:13 +00:00
Russell Keith-Magee 27b0077a48 Fixed #8509: Cleaned up handling of test cookies in admin logins. Thanks to rajeshd for the report of a problem case.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8509 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-24 06:34:18 +00:00
Russell Keith-Magee 74b3173fba Fixed #8511: Removed some tests that were failing on Python 2.4, but weren't really contributing anything anyway. Thanks to jarrow for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8508 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-24 05:06:17 +00:00
Malcolm Tredinnick a9f0ae706a Fixed #8203 -- Fixed temporary file deleation on Windows and a couple of edge
cases on Unix-like systems. Patch from snaury. Testing and verification on
Windows, Mac and Linux from cgrady and ramikassab.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8493 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-23 17:56:02 +00:00
Malcolm Tredinnick 8a3ef1f8bc Fixed #7499 -- Trim microseconds off rendering of form.TimeFields by default so
that they validate. Previous code didn't work with microseconds anyway, so this
is backwards compatible. Thanks to kevin for the patch.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8491 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-23 17:33:09 +00:00
Malcolm Tredinnick 646f2f6101 Fixed #7494 -- Fixed build_absolute_url() for some types of (uncommon) URLs.
Patch from tom@almostobsolete.net and RobotAdam.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8490 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-23 17:28:12 +00:00
Russell Keith-Magee 67402a6fb5 Reverted [8481] and [8482] while we work out what is going on with #8453 and the related discussions that I wasn't previously aware of.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8486 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-23 15:03:40 +00:00
Russell Keith-Magee a9ee1d4e28 Fixed #7776: Ensured that the test cookie is always deleted once a login has succeeded. Thanks for the report and fix, Mnewman.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8484 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-23 14:12:58 +00:00
Russell Keith-Magee 0f869f905e Fixed #7747: Altered EmailMessage such that messages with long subject lines don't use tabs in their continutation sequence. Tabs in subjects cause problems with Outlook and Thunderbird. Thanks to Mark Allison <mark.allison@maplecroft.com> for the report and fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8483 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-23 13:31:28 +00:00
Russell Keith-Magee b35acb3ee9 Corrected a test case error mistakenly committed in [8481].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8482 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-23 13:14:10 +00:00
Russell Keith-Magee 46da8ac9e5 Fixed #7443: Corrected a long standing mistake in the timesince/timeuntil filters when using a parameter for 'now'. Thanks to Andrew Shearer <ashearerw@shearersoftware.com> for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8481 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-23 12:52:04 +00:00
Brian Rosner a64dc39fb7 Fixed #7602 -- Corrected lookup keyword arguments in archive_month and archive_week to properly range when date_field is from DateField. Thanks nullie for the original patch and Colin Grady for the test coverage.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8476 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-23 04:46:33 +00:00
Malcolm Tredinnick d4d7bc175d Fixed #8046 -- The first filter() call on a related manager for many-to-many
fields no longer creates duplicate copies of the join table(s). Basically, this
means filters on the join table (for ManyToManyField(through=...)) and complex
filters in the normal (non-through) case don't produce incorrect or duplicate
results.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8472 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-22 22:00:28 +00:00
Russell Keith-Magee 343c255016 Fixed #8366: Modified a test fixture to remove an unnecessary forward reference. Thanks to Ramiro Morales for the suggestion.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8465 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-22 14:07:50 +00:00
Russell Keith-Magee e054295fed Fixed #8136: Added a signal emission when an error is raised handling an error. This was required for the test client to handle missing 404.html templates and errors in the 404.html template. Thanks to danfairs for the report and fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8464 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-22 13:59:41 +00:00
Malcolm Tredinnick f2477b6450 Fixed #7233 -- Ensured that QueryDict classes are always unpicklable. This
problem only arose on some systems, since it depends upon the order in which
the attributes are pickled. Makes reliable testing kind of tricky.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8460 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-21 13:55:21 +00:00
Malcolm Tredinnick 1e1f7c58bc Fixed #8381 -- Fixed a problem with appending slashes in the common middleware
when SCRIPT_NAME contains something other than '/'. Patch from jcassee.

Also fixed the middleware tests to work with this patch.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8456 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-21 01:32:18 +00:00
Malcolm Tredinnick b9407b26df Made it possible to pickle DateQuerySets.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8455 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-20 22:38:15 +00:00
Malcolm Tredinnick 5608dfabc3 Fixed #8434 -- I forgot to update the tests when committing [8443]. Thanks,
jarrow.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8449 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-20 15:56:07 +00:00
Malcolm Tredinnick 556fbc78a6 Fixed #8039 -- Make sure that extra(tables=...) tables are always included in
the resulting SQL. Previously, an optimisation was removing them in some corner
cases.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8429 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-17 22:38:36 +00:00
Malcolm Tredinnick e3ea9ddef5 Added a test to show that #8063 doesn't seem to be an issue any longer.
Refs #8063.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8427 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-17 20:18:52 +00:00
Malcolm Tredinnick 2c4b13cbe7 Changed the (internal) way extra(select=.., select_params=...) handling is done
so that parameters stay with their select items. This means that merging and
trimming of those items is handled correctly.

Refs #7957, #7961. Fixed #8191.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8426 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-17 20:07:59 +00:00
Gary Wilson Jr a949f9ec7d Fixed #3121 -- Made `get_or_create()` work for `RelatedManager` and `ManyRelatedManager`.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8415 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-16 20:59:06 +00:00
Malcolm Tredinnick c127f0117d Fixed #8283 -- Fixed an edge case when adding things to the "where" tree and
combining different connector types.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8413 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-16 20:40:00 +00:00
Russell Keith-Magee cbcc415934 Fixed #8229: Added handling for a special case in the validation of Spanish ID numbers. Thanks to Marc Garcia for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8405 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-16 07:00:30 +00:00
Russell Keith-Magee fc2c03b55c Fixed #8268: Modified admin scripts tests to use JYTHONPATH when appropriate. Thanks to leosoto for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8400 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-16 02:29:10 +00:00
Gary Wilson Jr 2b82a3bcfc Fixed #7331 -- Made `QueryDict.iteritems` behave like `QueryDict.items`, thanks jurev.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8399 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-16 02:17:55 +00:00
Gary Wilson Jr 6d863fef8a Fixed #5270 -- Allow template tags and filters to accept an emtpy string, patch from jdunck.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8393 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-15 21:08:11 +00:00
Gary Wilson Jr 727133109c Fixed #8290 -- Fixed DecimalField's cleaning of values with a large number of decimal places, based on patch from dgouldin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8391 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-15 20:09:47 +00:00
Malcolm Tredinnick 4881a4ffb0 Use failIf() instead of assertFalse() so that tests work with python 2.3.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8379 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-15 14:58:47 +00:00
Russell Keith-Magee 06ea872b20 Fixed #8244: Modified the temporary directory used by file storage tests so that mutliple test runs can be performed in parallel without conflict.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8376 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-15 13:16:16 +00:00
Russell Keith-Magee 50b548d01b Fixed #7416: Modified test client to preserve session when a user logs in. Thanks to lakin.wecker@gmail.com for the report and Eric Holscher for the patch and test case.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8372 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-15 12:08:29 +00:00
Matt Boersma 9223f063c8 Fixed doctest which relied on implicit ordering and was failing on Oracle.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8357 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-15 03:36:18 +00:00
Brian Rosner 2102967807 Fixed failing tests from [8352]. Thanks Alex Gaynor for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8354 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-14 21:03:44 +00:00
Russell Keith-Magee 29a9c34c65 Fixed #8286 -- Simplified the m2m intermediate serialization test to make it easier to debug, and less prone to failures caused by test execution order. Thanks to jarrow for the report, and Karen Tracey for her help confirming the problem.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8347 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-14 14:43:29 +00:00
Malcolm Tredinnick 4adf048a51 Fixed #8276 -- Changed the names of a few Polish localflavor classes to match
their common names/acronyms, similar to other localflavors.

Backwards incompatible if you're using these classes.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8345 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-14 04:29:02 +00:00
Jacob Kaplan-Moss d05c725308 Fixed #8253: fixed xmlns regression for Atom feeds, and in the process added a hook for adding attributes specifically on the root <rss> element (for RSS feeds only, of course). Patch by Justin Bronn.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8331 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-12 22:12:14 +00:00
Russell Keith-Magee 63ea57642d Fixed #8134 -- Corrected serialization of m2m fields with intermediate models. Thanks to Rock Howard for the report, and kire for the test case.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8321 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-12 12:58:33 +00:00
Russell Keith-Magee dd970bfbfd Deleted a block of test code that got duplicated in applying a patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8320 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-12 11:51:07 +00:00
Malcolm Tredinnick 6294fc7179 Changed "exact" matches in MySQL to use the database's native collation.
This effectively reverses the change in [7798]. It was proving too difficult to
successfully manage all the side effects here and provide a satisfactory
solution for everybody. Many thanks to arne, Martin von Löwis and, particular,
Karen Tracey, for doing a lot of research and proto-patches here to establish what was possible and practical.

This is backwards incompatible if you were relying on the behaviour after
[7798]. The docs have been updated to indicate the solution.

Refs #2170, #7789, #8102.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8319 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-12 07:52:33 +00:00
Malcolm Tredinnick 54c313af60 Added a quick regression test that shows why Meta.ordering and order_by()
aren't always equivalent. This is documented, stable behaviour, so we should
ensure it doesn't change accidentally.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8312 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-11 23:40:34 +00:00
Jacob Kaplan-Moss 942e5246ac Added a number of callbacks to SyndicationFeed for adding custom attributes and elements to feeds. Refs #6547.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8311 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-11 22:22:26 +00:00
Jacob Kaplan-Moss 899ca54fe2 Added a couple of extra syndication tests, and generally sanitized the existing ones. Refs #6547.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8310 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-11 20:49:19 +00:00
Jacob Kaplan-Moss efaa891b1f Fixed #8235: use subprocess instead of popen3 so that Python 2.6 is happy. Thanks, Karen Tracey.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8309 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-11 19:13:57 +00:00
Jacob Kaplan-Moss 58cd4902a7 Fixed #4948, a race condition in file saving. Thanks to Martin von Löwis, who diagnosed the problem and pointed the way to a fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8306 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-11 16:51:18 +00:00
Gary Wilson Jr c17c8ddecc Refs #7742 -- Got bug639 regression tests using newforms instead of oldforms.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8304 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-11 15:24:46 +00:00
Russell Keith-Magee 9dc4ba875f Fixed #5461 -- Refactored the database backend code to use classes for the creation and introspection modules. Introduces a new validation module for DB-specific validation. This is a backwards incompatible change; see the wiki for details.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8296 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-11 12:11:25 +00:00
Gary Wilson Jr ef48a3e69c Fixed #7830 -- Removed all of the remaining, deprecated, non-oldforms features:
* Support for representing files as strings was removed. Use `django.core.files.base.ContentFile` instead.
 * Support for representing uploaded files as dictionaries was removed. Use `django.core.files.uploadedfile.SimpleUploadedFile` instead.
 * The `filename`, `file_name`, `file_size`, and `chuck` properties of `UploadedFile` were removed. Use the `name`, `name`, `size`, and `chunks` properties instead, respectively.
 * The `get_FIELD_filename`, `get_FIELD_url`, `get_FIELD_size`, and `save_FIELD_file` methods for Models with `FileField` fields were removed. Instead, use the `path`, `url`, and `size` attributes and `save` method on the field itself, respectively.
 * The `get_FIELD_width` and `get_FIELD_height` methods for Models with `ImageField` fields were removed. Use the `width` and `height` attributes on the field itself instead.
 * The dispatcher `connect`, `disconnect`, `send`, and `sendExact` functions were removed. Use the signal object's own `connect`, `disconnect`, `send`, and `send` methods instead, respectively.
 * The `form_for_model` and `form_for_instance` functions were removed. Use a `ModelForm` subclass instead.
 * Support for importing `django.newforms` was removed. Use `django.forms` instead.
 * Support for importing `django.utils.images` was removed. Use `django.core.files.images` instead.
 * Support for the `follow` argument in the `create_object` and `update_object` generic views was removed. Use the `django.forms` package and the new `form_class` argument instead.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8291 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-10 21:10:47 +00:00
Russell Keith-Magee ec7d8b7c61 Fixed #5943 -- Modified django-admin to behave like manage.py if settings are provided, either as --settings or DJANGO_SETTINGS_MODULE. Thanks to Joseph Kocherhans and Todd O'Bryan for their work on this ticket.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8282 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-10 08:42:49 +00:00
Malcolm Tredinnick f6670e1341 Added a return value to the add() method for caches. It's now possible to tell
if a call to add() ended up storing something in the cache.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8278 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-10 03:52:21 +00:00
Brian Rosner 38dc472796 Fixed #7250 -- Don't show internal data of a FileField in the admin when the form does not validate. This also alternatively fixes a recent problem since [8244] when the form is not valid. Thanks Marc Garcia for the initial ticket.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8277 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-10 01:07:40 +00:00
Brian Rosner 65be56816f Fixed #5780 -- Adjusted the ModelAdmin API to allow the created/updated objects
to be passed to the formsets prior to validation.

This is a backward incompatible change for anyone overridding save_add or
save_change. They have been removed in favor of more granular methods
introduced in [8266] and the new response_add and response_change nethods.
save_model has been renamed to save_form due to its slightly changed behavior.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8273 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-09 20:52:40 +00:00
Jacob Kaplan-Moss 4747347385 Fixed #5801: admin requests with GET args now get properly bounced through login with those args intact. Thanks for the patch, Rozza.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8271 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-09 17:35:19 +00:00
Malcolm Tredinnick c763f26173 Updated the tests.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8268 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-09 17:19:44 +00:00
Jacob Kaplan-Moss 750f5c8d46 Fixed #8187: made PIL imports consistant. Thanks, bastih.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8257 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-09 14:18:09 +00:00
Jacob Kaplan-Moss 6185093351 Use a FileField instead of an ImageField in the admin_widgets test so that folks without PIL can still run the tests.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8255 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-08 23:06:28 +00:00
Jacob Kaplan-Moss 7899568e01 File storage refactoring, adding far more flexibility to Django's file handling. The new files.txt document has details of the new features.
This is a backwards-incompatible change; consult BackwardsIncompatibleChanges for details.

Fixes #3567, #3621, #4345, #5361, #5655, #7415.

Many thanks to Marty Alchin who did the vast majority of this work.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8244 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-08 20:59:02 +00:00
Jacob Kaplan-Moss 176fabcc6f Fixed #8047: property detect an external database backend and set sys.path accordingly. Patch from Leo Soto.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8238 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-08 18:48:18 +00:00
Malcolm Tredinnick ab8965c428 Added a few force_unicode() calls around objects in the admin. Required for
Python 2.3 compatibility. Patch from nfg.

Refs #8151, #8153.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8236 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-08 18:07:33 +00:00
Malcolm Tredinnick afa98dba98 Added an import that was missed in [8193]. Thanks Karen Tracey. Fixed #8143.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8233 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-08 16:03:49 +00:00
Russell Keith-Magee 9dfad99257 Fixed #8120, #7997 -- Cleaned up the help messages displayed by django-admin so that the lax options aren't repeated, and the lax options are displayed when no subcommand is provided. Thanks to Scott Moonen <smoonen@andstuff.org> and trevor for the respective reports.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8228 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-08 13:40:11 +00:00
Russell Keith-Magee 196b282775 Fixed #5825 -- Modified the custom command loader to allow for explicit specification of the project name, even if the project directory isn't in the python path. This brings custom command loading into alignment with application loading. Thanks to jdetaeye@frepple.com for the original report, and to abozanich for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8227 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-08 12:27:40 +00:00
Jacob Kaplan-Moss 34a3bd5225 Major refactoring of django.dispatch with an eye towards speed. The net result is that signals are up to 90% faster.
Though some attempts and backwards-compatibility were made, speed trumped compatibility. Thus, as usual, check BackwardsIncompatibleChanges for the complete list of backwards-incompatible changes.

Thanks to Jeremy Dunck and Keith Busell for the bulk of the work; some ideas from Brian Herring's previous work (refs #4561) were incorporated.

Documentation is, sigh, still forthcoming.

Fixes #6814 and #3951 (with the new dispatch_uid argument to connect).


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8223 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-06 15:32:46 +00:00
Jacob Kaplan-Moss 593810a501 Fixed #7904: added support for a "use_for_related_fields" property on managers. If True, the manager will be used for related object lookups instead of the "bare" QuerySet introduced bu [8107]. Patch from Justin Bronn.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8212 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-05 16:13:28 +00:00
Luke Plant c768bc6f25 Fixed #8031 - url tag no longer silences NoReverseMatch exceptions since this is very rarely useful
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8211 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-05 14:16:13 +00:00
Gary Wilson Jr daa6b38f35 Fixed #8092, #3828 -- Removed dictionary access for request objects so that GET and POST data doesn't "overwrite" request attributes when used in templates (since dictionary lookup is performed before attribute lookup). This is backwards-incompatible if you were using the request object for dictionary access to the combined GET and POST data, but you should use `request.REQUEST` for that instead.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8202 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-03 19:55:26 +00:00
Gary Wilson Jr 3d918f41f5 Added tests for accessing nullable ForeignKey after saving and fetching from the database (refs #8093).
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8198 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-03 03:03:46 +00:00
Gary Wilson Jr c85c8f8891 Fixed #7919 -- md5 and sha modules are deprecated since Python 2.5, use hashlib module when available. Patch from Karen Tracey.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8193 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-02 05:56:57 +00:00
Gary Wilson Jr 351a3ca154 Removed several deprecated features for 1.0 (refs #7830):
* "simple" cache backend
 * `ObjectPaginator`
 * `edit_inline_type` argument for `ForeignKey` fields
 * `QOperator`, `QNot`, `QAnd` and `QOr`
 * `maxlength` argument 


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8191 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-02 04:56:11 +00:00
Gary Wilson Jr cbbd54d5cd Fixed #7920 -- Made tests compatible with Python 2.6's Decimal repr change, patch from Karen Tracey.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8190 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-02 04:48:14 +00:00
Gary Wilson Jr 2db4b13480 Fixed #8070 -- Cache related objects passed to Model init as keyword arguments. Also:
* Model init no longer performs a database query to refetch the related objects it is passed.
 * Model init now caches unsaved related objects correctly, too. (Previously, accessing the field would raise `DoesNotExist` error for `null=False` fields.)
 * Added tests for assigning `None` to `null=True` `ForeignKey` fields (refs #6886).


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8185 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-01 23:16:59 +00:00
Brian Rosner be17a801f6 Fixed #7885 -- Prevent duplicates in fields and fieldsets declarations. Thanks julien and wamberg for the patches.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8173 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-01 18:55:43 +00:00
Russell Keith-Magee 9a56fe765e Corrected a typo in [8158]. Thanks to Matthias Kestenholz <mk@spinlock.ch> for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8161 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-31 13:28:51 +00:00
Russell Keith-Magee 9ea8184da8 Refs #8047 -- Removed some CPython specific parts of the admin scripts tests.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8158 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-31 08:32:19 +00:00
Russell Keith-Magee 0dc11a0c1d Fixed #8029 -- Modified admin_scripts test to use the PYTHONPATH from the environment where the test is executed. Thanks to Ramiro and Alex Gaynor for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8149 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-30 09:29:51 +00:00
Malcolm Tredinnick 281f2b74bf Fixed #8023 -- Allow filtering of DecimalFields (in models) using strings.
At the same time, checked all other cases of db_prep_value() to ensure they
aren't making the same mistake.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8143 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-30 00:18:49 +00:00
Malcolm Tredinnick 1ba2d6888f Since max_digits and decimal_places are required on django.db.models.DecimalField, one of the tests was a bit bogus. Fixed that.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8142 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-30 00:18:31 +00:00
Russell Keith-Magee 174641b9b3 Fixed #6095 -- Added the ability to specify the model to use to manage a ManyToManyField. Thanks to Eric Florenzano for his excellent work on this patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8136 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-29 12:41:08 +00:00
Malcolm Tredinnick f752f69238 Fixed #7767 -- Fixed template egg loading test for Windows systems.
Thanks, Ramiro Morales.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8135 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-29 06:05:15 +00:00
Malcolm Tredinnick b3b71a0922 Fixed #7560 -- Moved a lot of the value conversion preparation for
loading/saving interactions with the databases into django.db.backend. This
helps external db backend writers and removes a bunch of database-specific
if-tests in django.db.models.fields.

Great work from Leo Soto.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8131 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-29 05:09:29 +00:00
Gary Wilson Jr 7bc728c826 A few corrections to my docstrings in [8129].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8130 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-28 20:35:39 +00:00
Gary Wilson Jr 96cf3656c4 Fixed #6997 -- Corrected `num_pages` calculation when one item is in the object list and `allow_empty_first_page=False`, thanks to framos for the report. Also, made Page's `start_index()` return 0 if there are no items in the object list (previously it was returning 1, but now it is consistent with `end_index()`). As an added bonus, I threw in quite a few pagination tests.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8129 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-28 05:30:35 +00:00
Malcolm Tredinnick 19c7db0058 Fixed #7853 -- Fixed another case of deleting inherited models with foreign key
references. Thanks to Russell for the test case that demonstrated the problem.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8128 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-28 01:32:46 +00:00
Malcolm Tredinnick 82a85fdbae Fixed #6427 -- Added some more features to the Austrian localflavor.
Thanks, Horst Gutmann.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8113 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-27 18:54:56 +00:00
Malcolm Tredinnick ce15b389c1 Fixed the admin_scripts tests to check for the right output with Python 2.4.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8108 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-27 18:25:06 +00:00
Malcolm Tredinnick 4fee39c63c Fixed #7872 -- Fixed a missed case of promoting table joins when using
disjunctive filters. Thanks to Michael Radziej for the failing test case.
problem.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8107 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-27 18:16:17 +00:00
Russell Keith-Magee 12eba9efc1 Removed some model saves from [8102] which were causing test failures under Postgres. Thanks to Ramiro Morales for the report (via IRC).
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8104 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-27 13:55:35 +00:00
Russell Keith-Magee 661f62be3c Fixed #7913 -- Corrected backwards incompatible parts of [7977] when optgroup handling was added to field choices (Ticket #4412). Thanks to Michael Elsdorfer (miracle2k) for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8102 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-27 07:22:39 +00:00
Malcolm Tredinnick 3cbe73692e Fixed #7778 -- Fixed a tricky case of foreign key clearing with inherited
models. Patch from James Murty.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8100 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-27 04:18:52 +00:00
Malcolm Tredinnick ccab4b041b Fixed #7981 -- Wrap the manual transaction management in the
serializers_regress tests in some "try...finally" blocks. Patch from Leo Soto.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8099 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-27 03:32:44 +00:00
Malcolm Tredinnick f48855178d Fixed #7530, #7716 -- When using select_related() and encountering a NULL
related object, populate the attribute correctly. Patch from Bastien Kleineidam.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8098 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-27 01:18:23 +00:00
Malcolm Tredinnick 103d484807 Fixed #7658 -- Added some Windows-specific tempfile handling. The standard
stuff doesn't work with the way Django's file uploading code wants to operate.
Patch from Mike Axiak.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8096 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-26 22:48:51 +00:00
Malcolm Tredinnick e29aece743 Fixed #4534 -- Added an "else" option to the "ifchanged" template tag.
Patch from SmileyChris.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8095 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-26 22:09:43 +00:00
Malcolm Tredinnick 108b604b51 Fixed #7345 -- When normalising the URLField form field, attach a trailing
slash when only a host (no path) is given. Thanks, jpwatts.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8089 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-26 05:18:39 +00:00
Malcolm Tredinnick a26ba33111 Fixed #7686 -- Added an Austrian localflavor. Thanks, bernd.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8087 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-26 04:25:42 +00:00
Malcolm Tredinnick fe240b18f6 Removed some completely pointless test changes from [8084], since they were
already being tested. Thank, Marty. /me is dumb. :-(


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8085 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-26 04:10:40 +00:00
Malcolm Tredinnick 6f16b5bad2 Fixed #7967 -- Make sure the __contains__ method in the cache backends call the
right has_key() method for the subclass. Patch from Marty Alchin.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8084 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-26 03:58:31 +00:00
Malcolm Tredinnick f49c5c23f9 Fixed #7574 -- Fixed the handling of lazy translation in email headers.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8083 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-26 03:37:25 +00:00
Gary Wilson Jr b149e3d9e7 Corrected typo.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8082 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-26 03:31:22 +00:00
Jacob Kaplan-Moss 7b3cf13d32 Improved admin model registration options: you can now register using register(Model, **options) and even register(Model, ModelAdmin, **options). This isn't documented yet -- a much expanded version of docs/admin.txt is on the way.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8063 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-23 18:58:06 +00:00
Malcolm Tredinnick a7b556ca04 Allow for matches against unsaved objects in querysets (which will therefore
match nothing). This allows for some more straightforward code in the admin
interface.

Fixed #7488 (all the debugging there was done by Brian Rosner, who narrowed it
down to the item in this patch).


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8061 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-23 06:12:15 +00:00
Malcolm Tredinnick 681e7bbd25 Removed some potentially misleading code (it isn't executed) after the changes
in [8055]. Thanks, Karen. Refs #7745.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8059 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-23 04:41:53 +00:00