Commit Graph

651 Commits

Author SHA1 Message Date
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