Commit Graph

1158 Commits

Author SHA1 Message Date
Russell Keith-Magee 0cffff024b Fixed #7441 - Improved the doctest OutputChecker to be more lenient with JSON an XML outputs. This is required so that output ordering that doesn't matter at a semantic level (such as the order of keys in a JSON dictionary, or attributes in an XML element) isn't caught as a test failure. Thanks to Leo Soto for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7981 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-19 14:46:55 +00:00
Russell Keith-Magee 649463dd34 Fixed #4412 -- Added support for optgroups, both in the model when defining choices, and in the form field and widgets when the optgroups are displayed. Thanks to Matt McClanahan <cardinal@dodds.net>, Tai Lee <real.human@mrmachine.net> and SmileyChris for their contributions at various stages in the life of this ticket.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7977 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-19 07:53:02 +00:00
Russell Keith-Magee 825622d912 Fixed #7773 -- Added some simple tests for EmailMessage. Thanks to serialx for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7975 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-19 02:38:41 +00:00
Jacob Kaplan-Moss 46786b4193 Fixed #7741: django.newforms is now django.forms. This is obviously a backwards-incompatible change. There's a warning upon import of django.newforms itself, but deeper imports will raise errors.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7971 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-19 01:22:26 +00:00
Brian Rosner a19ed8aea3 Merged the newforms-admin branch into trunk.
This is a backward incompatible change. The admin contrib app has been
refactored. The newforms module has several improvements including FormSets
and Media definitions.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7967 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-18 23:54:34 +00:00
Jacob Kaplan-Moss 7997133a3d Fixed #3639: updated generic create_update views to use newforms. This is a backwards-incompatible change.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7952 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-18 19:45:00 +00:00
Jacob Kaplan-Moss cd80ce7a3d Added missing files form [7946]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7950 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-18 17:39:31 +00:00
Malcolm Tredinnick c681f4070c Removed the mysql_old backend. It smells bad and has no friends.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7949 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-18 17:38:53 +00:00
Adrian Holovaty df2b19cc17 Fixed #1443 -- Django's various bits now support dates before 1900. Thanks to SmileyChris, Chris Green, Fredrik Lundh and others for patches and design help
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7946 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-18 03:47:27 +00:00
Russell Keith-Magee c4d0cfe1ee Refs #7745 -- Modified use of assertTrue to failUnless, because assertTrue isn't available in Python 2.3. Thanks to Karen Tracey for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7941 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-17 13:29:35 +00:00
Malcolm Tredinnick 431206a252 Fixed #7786 -- Removed some tests from running when using Python 2.3.
The problem being "hidden" here is not serious. It won't affect correct code
and only gives a different failure mode for incorrect code. The moral is: don't
write incorrect code.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7939 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-16 23:55:10 +00:00
Malcolm Tredinnick 52fdedba48 Fixed #7759 -- Fixed QuerySet.count() when the results cache was only partially
populated.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7938 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-16 23:17:29 +00:00
Malcolm Tredinnick 3b37c8151a Fixed #7411 -- worked around some possible transaction conflicts in SQLite.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7926 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-15 18:47:32 +00:00
Russell Keith-Magee e867c5a0cc Removed a Python2.3 incompatible generator construct. Thanks to Karen Tracey for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7921 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-14 04:57:01 +00:00
Russell Keith-Magee be6ca58d43 Fixed #7728 -- Modified the output check in the admin script tests. Checking for pyc is a CPython-specific check, and it breaks CPython if pyc files aren't generated (due to permission problems, etc). Thanks to Maciej Fijalkowski (fijal) for the report and fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7915 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-13 08:57:30 +00:00
Russell Keith-Magee 32b8c3e1c0 Fixed #7718 -- Added a naive implementation of sorted() for Python 2.3 compatibility, and modified test cases to import the function when required.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7914 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-13 08:48:18 +00:00
Jacob Kaplan-Moss 185ba8f7e4 FIxed #7696: fixed model_form tests on Windows after [7814]. Thanks, Marty Alchin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7909 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-12 20:44:05 +00:00
Jacob Kaplan-Moss 8e852a92ec Fixed #7613: fixed file_upload tests when LANG=C. Thanks, eddymul.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7904 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-12 20:43:03 +00:00
Russell Keith-Magee 4aa6c57251 Fixed #7583 -- Corrected the testing docs that referred to the defunct headers attribute of the response. Added a test case to validate (and document) the new behavior. Thanks to Malcolm for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7900 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-12 06:16:42 +00:00
Russell Keith-Magee e31945a2ad Fixed #7303 -- Clarified a test case that was dependent on dict ordering. Thanks to leosoto for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7890 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-11 14:29:47 +00:00
Russell Keith-Magee 8e0b6bdcd5 Fixed #6017 -- Modified the Lax parser to allow --settings and the other core management arguments to appear anywhere in the argument list. Thanks to Todd O'Bryan for the suggestion and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7888 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-11 13:18:19 +00:00
Russell Keith-Magee 4516233f9e Fixed #7715 -- Modified the admin_scripts tests to do an app level import, rather than a project level import. This removes the potential for conflict between the admin script tests and the settings for the test suite itself. Thanks to Malcolm Tredinnick for his help hunting this one down.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7887 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-11 13:04:17 +00:00
Malcolm Tredinnick 2b193f6100 Fixed #7698 -- Handle '0' correctly when used as the upper bound of a slice.
Based on a patch from enoksrd.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7885 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-11 12:43:27 +00:00
Malcolm Tredinnick 7936c0b917 Fixed #7448 -- Convert "in" filters to pass in the correct values for datetimes
and similar complex objects.

Based on patches from cgrady and alexkosholev. Refs #7707.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7883 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-11 09:00:35 +00:00
Russell Keith-Magee e18fccc62e Corrected a bug in [7876] picked up by the buildbot: depending on the order in which tests are run, some tests would fail because of a dependency on the current working directory.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7877 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-10 13:53:45 +00:00
Russell Keith-Magee 9376d4ed5b Refs #5943, #6107 -- Added framework and tests to check for the correct operation of django-admin and manage.py. Thanks for Simon Willison and Karen Tracey for their contributions and assistance testing this patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7876 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-10 12:12:41 +00:00
Malcolm Tredinnick a616b92174 Fixed test suite after [7687].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7868 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-08 05:28:37 +00:00
Jacob Kaplan-Moss a28b75b0ba Fixed #7614: the quickening has come, and there now is only one UploadedFile. On top of that, UploadedFile's interface has been improved:
* The API now more closely matches a proper file API. This unfortunately means a few backwards-incompatible renamings; see BackwardsIncompatibleChanges. This refs #7593.
  * While we were at it, renamed chunk() to chunks() to clarify that it's an iterator.
  * Temporary uploaded files now property use the tempfile library behind the scenes which should ensure better cleanup of tempfiles (refs #7593 again).

Thanks to Mike Axiak for the bulk of this patch.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7859 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-07 23:16:00 +00:00
Jacob Kaplan-Moss 9dabd1f8ff Fixed #7651: uploading multiple files with the same name now work. Also, in order to test the problem the test client now handles uploading multiple files at once. Patch from Mike Axiak.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7858 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-07 22:06:32 +00:00
Malcolm Tredinnick 5deb4fcbb9 Revert [7849] and [7850]. Brain failure on my part.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7851 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-06 14:20:30 +00:00
Malcolm Tredinnick c88e55b4fe Some tests for the new features. These pretty much fail at the moment. Based on
SmileyChris's original work.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7849 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-06 14:16:43 +00:00
Ian Kelly 0650bab492 Fixed a test case using extra sql that didnt fit Oracle syntax.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7832 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-03 19:02:43 +00:00
Ian Kelly f7903f7479 Renamed a field in a test case that was preventing the tests from
running in Oracle.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7826 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-02 16:59:17 +00:00
Gary Wilson Jr 54d50ef5c8 Made legacy `ObjectPaginator` truly backwards-compatible by catching both `AttributeError` and `TypeError` in `_get_count` as it did before
[7306].  Tests included.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7819 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-02 04:31:28 +00:00
Jacob Kaplan-Moss d725cc9734 Fixed #2070: refactored Django's file upload capabilities.
A description of the new features can be found in the new [http://www.djangoproject.com/documentation/upload_handing/ upload handling documentation]; the executive summary is that Django will now happily handle uploads of large files without issues.

This changes the representation of uploaded files from dictionaries to bona fide objects; see BackwardsIncompatibleChanges for details.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7814 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-01 15:10:51 +00:00
Russell Keith-Magee 415bd694f9 Fixed #7521 -- Added the ability to customize ROOT_URLCONF for the duration of a TestCase. Thanks to Mark Fargas (telenieko) for his work on this patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7805 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-30 12:34:29 +00:00
Russell Keith-Magee 9eaa05912c Fixed #7572 -- Force the closure of the database connection at the end of fixture loading as a workaround for MySQL bug #37735. Thanks to Simon Litchfield for his help in narrowing down this issue.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7803 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-30 12:18:29 +00:00
Malcolm Tredinnick abcf1cb36d Fixed #5957 -- Enforce the "required" attribute on BooleanField in newforms.
This has been the documented behaviour for ages, but it wasn't correctly
implemented. A required BooleanField must be True/checked, since False values
aren't submitted. Ideal for things like "terms of service" agreements.

Backwards incompatible (since required=True is the default for all fields).

Unclear who the original patch was from, but Tai Lee and Alex have kept it up
to date recently.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7799 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-30 10:44:56 +00:00
Malcolm Tredinnick 8e816c8304 Fixed #2170 -- "exact" lookups in MySQL are now case-sensitive (the same as other backends).
This is a backwards incompatible change if you were relying on 'exact' being
case-insensitive. For that, you should be using 'iexact'.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7798 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-30 10:25:35 +00:00
Malcolm Tredinnick 52cc11c4e2 Fixed #4485 -- Allow nullable DecimalFields to store NULLs.
Based on a patch from tdterry. Thanks.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7797 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-30 10:07:06 +00:00
Malcolm Tredinnick 5da47e43c7 Fixed #7314 -- Changed the way extra() bits are handled when QuerySets are merged.
Also added a section to the documentation to indicate why it's probably not a
good idea to rely on this feature for complex stuff. Garbage in, garbage out
applies even to Django code.

Thanks to erik for the test case for this one.


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


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


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


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


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


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

Fixed #7128, #7204, #7506.


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


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

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


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


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

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

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


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


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

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


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


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

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7600 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-09 14:03:35 +00:00
Jacob Kaplan-Moss 31d9dc07aa Fixed #7369: fixed a corner-case involving select_related() following non-null FKs after null ones. Thanks, George Vilches
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7597 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-08 18:13:46 +00:00
Russell Keith-Magee 511e01d978 Fixed #4371 -- Improved error checking when loading fixtures. Code now catches explicitly named fixture formats that are not supported (e.g, YAML fixtures if you don't have PyYAML installed), and fixtures that are empty (which can happen due to XML tag errors). Thanks to John Shaffer for the suggestion, and Keith Bussell for his work on the fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7595 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-08 08:21:18 +00:00
Russell Keith-Magee 8a7bbc3c34 Fixed #5836 -- Corrected the logic in the Test Client when an exception raised by a view is caught and re-raised. Thanks for the report, test case, and fix, Chris Wagner.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7583 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-07 06:25:59 +00:00
Russell Keith-Magee 08401959d8 Fixed #7165 -- Added an assertNotContains() method to the test client. Thanks for the suggestion and implementation, J. Pablo Fernandez <pupeno@pupeno.com>.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7578 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-06 13:50:02 +00:00
Russell Keith-Magee 46cd8bb5b6 Fixed #7143 -- Modified the test client to better match (most) real browser behavior when uploading files. Now, only the file name is sent, rather than the full path. Thanks for the report, cpinto.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7577 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-06 13:39:42 +00:00
Russell Keith-Magee d234e92740 Fixed #6168 -- Updated the Django system test runner to make it possible to run the invalid_models test (and any other invalid_ test) explicitly, rather than just as part of the full suite. Thanks for tracking down the problem, Eric Florenzano.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7576 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-06 12:55:38 +00:00
Russell Keith-Magee ed1c21171c Fixed #7366 -- Modified a few expected test outputs to remove the dependency on dictionary ordering. Thanks for the patch, Leo Soto.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7575 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-06 11:47:47 +00:00
Jacob Kaplan-Moss 1452d46240 Fixed #6886: Tightened up ForeignKey and OneToOne field assignment. Specifically:
* Raise a ValueError if you try to assign the wrong type of object.
  * Raise a ValueError if you try to assign None to a field not specified with null=True.
  * Cache the set value at set time instead of just at lookup time.

This is a slightly backwards-incompatible change; see BackwardsIncompatibleChanges for more details.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7574 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-06-05 00:39:32 +00:00
Jacob Kaplan-Moss 08d468db92 Fixed a messy test case (regressiontests/templates/loaders) that could cause future tests to fail by not cleaning up after itself.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7567 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-05-30 23:24:23 +00:00
Russell Keith-Magee d53e8f1285 Fixed #6430 -- Corrected the loading of templates from eggs, which was broken by the unicode merge. Thanks for the excellent report and patch, Juan Manuel Caicedo <juan.manuel.caicedo@gmail.com>.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7565 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-05-29 13:11:23 +00:00
Russell Keith-Magee 5837a45bd9 Fixed #7173 -- Corrected the caching of objects in reverse OneToOne relationships. Thanks, Travis Terry.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7561 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-05-29 12:17:03 +00:00
Adrian Holovaty 14d6ee2dc9 Changed Query.get_columns() to quote the 'AS' column names in an extra_select situation, to match pre-queryset-refactor behavior. Added unit tests that verify this and provide an example
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7502 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-04-28 21:15:05 +00:00
Ian Kelly 13a6fd61c6 Renamed a field in the queries test schema that was preventing the tests from running in Oracle. I've opened #7109 to address the general problem. Refs #7109
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7501 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-04-28 17:31:08 +00:00
Malcolm Tredinnick ff6e529502 Added a test to demonstrate the remaining problem in #7095.
Only fails for MySQL (because they've made some interesting syntax choices).
Refs #7095.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7495 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-04-28 11:51:16 +00:00
Malcolm Tredinnick e07a457c00 Fixed #7096 -- The simplifications in [7461] weren't complete. They broke
multi-component exclude() calls. Fixed that.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7493 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-04-28 04:29:06 +00:00
Malcolm Tredinnick 356dfd5308 Fixed #7098 -- Old-style related-model order_by() syntax was being incorrectly
marked as erroneous. It's just more dangerous and risky, not forbidden. This
commit restores backwards compatibility there.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7490 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-04-28 02:27:19 +00:00
Adrian Holovaty 9c53847ef4 Added some tests to modeltests/many_to_one that demonstrate a post-queryset-refactor bug in dates(). Refs #7097
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7485 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-04-28 00:03:01 +00:00
Malcolm Tredinnick 9c52d56f6f Merged the queryset-refactor branch into trunk.
This is a big internal change, but mostly backwards compatible with existing
code. Also adds a couple of new features.

Fixed #245, #1050, #1656, #1801, #2076, #2091, #2150, #2253, #2306, #2400, #2430, #2482, #2496, #2676, #2737, #2874, #2902, #2939, #3037, #3141, #3288, #3440, #3592, #3739, #4088, #4260, #4289, #4306, #4358, #4464, #4510, #4858, #5012, #5020, #5261, #5295, #5321, #5324, #5325, #5555, #5707, #5796, #5817, #5987, #6018, #6074, #6088, #6154, #6177, #6180, #6203, #6658


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7477 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-04-27 02:50:16 +00:00
Gary Wilson Jr 165772f37e Comment correction, `get_list` is now `filter`.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7379 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-29 15:26:58 +00:00
Malcolm Tredinnick 23912ebbe2 Added a test for month selection under SQLite in case an old possible bug ever
resurfaces. Patch from Pilippe Raoult.

Fixed #659


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7359 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-24 14:19:12 +00:00
Malcolm Tredinnick 622a6447f9 Fixed #6868 -- Fixed test results for Windows systems. Thanks, Ned Batchelder.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7355 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-24 13:10:48 +00:00
Malcolm Tredinnick 675db84f23 Fixed #5917 -- More error robustness in date parsing in SelectDateWidget, plus
keep the original date selected on redisplay, even if it was bogus (e.g. 31
Feb). Patch from SmileyChris.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7337 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-20 07:44:46 +00:00
Malcolm Tredinnick 463a03d7e3 Fixed #6825 -- Fixed the model_forms tests to also work on Windows by making
the filename detection a lot looser. Thanks, jerickso.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7335 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-20 07:19:53 +00:00
Malcolm Tredinnick f8578d7f19 Forgot to commit a new file from [7328].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7332 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-20 06:56:46 +00:00
Malcolm Tredinnick b3b8422363 Fixed #6445 -- Allow model instances to be used as a default for ForeignKeys
(via a callable). Also updates the documentation of the "default" attribute to
indicate a callable can be used. Thanks, Philipe Raoult.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7331 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-20 06:56:23 +00:00
Malcolm Tredinnick 597f9d6105 Fixed #5982 -- Changed test client's URL processing to match core's (everything
gets run through urllib.unquote()). Patch from Leo Shklovskii and Russell
Keith-Magee.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7330 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-20 06:50:54 +00:00
Malcolm Tredinnick 6417f5247b Merged the tests and documentation from #4720 to support the changes in [7295].
Thanks, Andy Gayton. Fixed #4720. Refs #5855.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7328 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-20 06:35:53 +00:00
Jacob Kaplan-Moss 649cdf907d Fixed #4620: you can now easily add custom labels to ModelChoiceFields via subclassing. Thanks, PhiR.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7326 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-19 23:10:45 +00:00
Jacob Kaplan-Moss 4457ba002d Fixed #5894: added FilePathField to newforms. Thanks, Alex Gaynor.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7323 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-19 22:29:11 +00:00
Jacob Kaplan-Moss bc1f67a6de Replaced dict reprs in tests with explicit looks at each key. This should fix many spurious test failures on other VMs (first noticed on Jython).
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7322 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-19 19:11:51 +00:00
Adrian Holovaty 6c2a78b266 Changed pagination tests to suppress the DeprecationWarning
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7308 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-18 21:53:39 +00:00
Adrian Holovaty d67208f5be Added a new and improved Paginator class, which allows you to pass a Page object to the template instead of 5 or 6 separate variables. ObjectPaginator still exists for backwards compatibility but issues a DeprecationWarning
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7306 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-18 21:13:48 +00:00
Malcolm Tredinnick ec0bbc15a8 Fixed #6230: Fixed the addition of id values to the select widgets in
SelectDateWidget. Thanks, Matt McClanahan.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7291 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-18 14:20:43 +00:00
Gary Wilson Jr d0032458a2 Fixed #6679 -- In `decorator_from_middleware`, don't unpack arguments when calling a middleware's
`process_view` method, thanks Gulopine.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7269 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-17 17:47:34 +00:00
Malcolm Tredinnick fac84c0bf4 Tweaked an i18n test that is a bit sensitive to Python versions. It returns
unexpected results on Python 2.4, so we ignore it there, too.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7264 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-17 16:03:46 +00:00
Malcolm Tredinnick 50ecd75379 Fixed #6492 -- Added bullet-proofing to isValidFloat validator. Thanks, Bastian Kleineidam.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7258 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-17 14:05:43 +00:00
Malcolm Tredinnick 30bdabb2b0 Fixed #6764 -- Added some error checking around cookie decoding. Thanks,
Michael Axiak.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7257 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-17 13:49:04 +00:00
Gary Wilson Jr 4487be66ef Fixed tests added in [7200] to not depend on unpredictable key order of dict, which was sometimes causing a test error.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7207 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-08 14:41:13 +00:00
Gary Wilson Jr d73c70d1ed Fixed #5595 -- Made `ModPythonRequest.__repr__` return a string instead of a unicode object. Fixes the printout of the request object in those server error e-mails I never get :)
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7200 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-03-08 03:06:30 +00:00
Jacob Kaplan-Moss a9b4efc82b Re-enable substring lookups for IP address fields in Postgres using HOST() Thanks for the suggestion, Thomas Adamcik. Fixes #708.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7161 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-26 23:12:47 +00:00
Jacob Kaplan-Moss f7fbc289ad Reverted [7151] since it breaks exact IP lookups on PostgreSQL. Reopens #708
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7160 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-26 22:17:45 +00:00
Jacob Kaplan-Moss df5fef33c9 Beefed up support for "lazy" related objects. Now, in addition to ForeignKey("Model") you can also say ForeignKey("app.Model"). This means that cross-app recursive relations now work.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7158 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-26 21:13:16 +00:00
Jacob Kaplan-Moss 297a12c2d1 Fixed a missing __init__.py from [7153]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7157 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-26 20:23:10 +00:00
Gary Wilson Jr 5ca0b9203b Fixed #5701 -- Fixed decorators to take the name, attributes, and docstring of the function they decorate by adding a modified version of the `functools.wraps` function from Python 2.5. `wraps` has been altered to work with Django's `curry` function and with Python 2.3, which doesn't allow assignment of a function's `__name__` attribute. This fixes severaly annoyances, such as the online documentation for template filters served by the admin app. This change is backwards incompatible if, for some reason, you were relying on the name of a Django decorator instead of the function it decorates.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7153 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-25 06:02:35 +00:00
Malcolm Tredinnick 6482f1f887 Fixed #708 -- Fixed searching within IP fields on PostgreSQL.
Based on a patch from Matt McClanahan.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7151 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-23 09:15:35 +00:00
Malcolm Tredinnick 32402773f1 Fixed #3689, #5223 -- Fixed "1st of January" comparisons for SQLite without breaking the other backends.
Based on a patch from raminf and tests from Nebojsa Djordjevic.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7150 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-23 08:36:41 +00:00
Russell Keith-Magee c1f45c326c Fixed #6436 -- Added check for absolute paths in fixture loading. Fixtures specified as an absolute path were being loaded multiple times. Thanks to btoll@bestweb.net for the report, fix, and catch of a duplicate ticket.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7145 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-22 12:50:10 +00:00
Malcolm Tredinnick 54546f23f0 Fixed #6627 -- Made dict.clear() work for SortedDicts.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7140 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-21 21:27:44 +00:00
Malcolm Tredinnick 343fa35a2c Fixed #2936, #6500 -- Added a __hash__() method to Models (since we implement our own __eq__ method).
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7132 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-19 01:59:34 +00:00
Malcolm Tredinnick e7b2ad8020 Fixed #6611 -- When copying a SortedDict, make a new copy of the keys list.
Thanks, Jeremy Dunck.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7129 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-18 23:08:51 +00:00
Malcolm Tredinnick b893eb4d7a Removed a portion of the test suite that was a pain on Python 2.3.
No actual useful functionality is lost by this; it's just a 'keep the Buildbot
happy" thing.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7120 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-15 15:17:48 +00:00
Malcolm Tredinnick d9a3c1b9fc Made a bunch of tiny documentation formatting and typo fixes.
Thanks, quicklizard, adamv, Gary Wilson, superjudge and David Pretty.

Fixed #6554, #6573 ,#6592, #6595, #6608.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7119 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-15 11:38:53 +00:00
Malcolm Tredinnick 1159791cd5 Modified [7112] to make things behave more in line with Python subclassing when subclassing ModelForms.
Meta can now be subclassed and changes on the child model affect the fields
list. Also removed a block of error checking, since it's harder to mess up in
unexpected ways now (e.g. you can't change the model and get the entirely wrong
fields list), so it was a level of overkill.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7115 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-14 17:38:05 +00:00
Malcolm Tredinnick 37962ecea7 Fixed #6337. Refs #3632 -- Fixed ModelForms subclassing, to the extent that it can be made to work.
This ended up being an almost complete rewrite of ModelForms.__new__, but
should be backwards compatible (although the text of one error message has
changed, which is only user visible and only if you pass in invalid code).

Documentation updated, also.

This started out as a patch from semenov (many thanks!), but by the time all
the problems were hammered out, little of the original was left. Still, it was
a good starting point.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7112 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-14 12:56:49 +00:00
Malcolm Tredinnick 0a3c8f03e0 Fixed #6409 -- Unbreak compound locale name parsing (e.g. zh-cn).
This was inadvertently broken back in [6608]. Slightly backwards-incompatible:
people specifying "es_AR" in their LANGUAGES list will need to change that to
"es-ar". Thanks, simonb and Ramiro Morales for making the effort to fix this.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7091 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-06 01:04:30 +00:00
Malcolm Tredinnick 0c4ea9b922 Fixed #6279, #6514 -- Fixed some HTML escaping problems in the urlize filter.
Based on a patch from SmileyChris with some test additions from Rob Hudson.
Thanks, both.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7079 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-03 08:54:26 +00:00
Malcolm Tredinnick 2542b94fb2 Fixed #6465 -- Tweaked MergeDict.getlist() to work with Django's MultiValueDict class. Thanks, Matt McClanahan.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7062 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-03 02:02:41 +00:00
Malcolm Tredinnick d18a114f86 Fixed #6326 -- Made the test for translations of filter arguments test something that has a chance of failure. Thanks akaihola.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7060 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-03 01:49:55 +00:00
Gary Wilson Jr cc7c6f3e46 Fixed #5422 -- Added a `raw` parameter to model `pre_save` and `post_save` signals, based on patch from `graham.carlyle@maplecroft.net`.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7054 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-02-01 17:32:29 +00:00
Jacob Kaplan-Moss 755278253e Fixed #6302 for ImageFields.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7025 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-01-18 15:53:19 +00:00
Joseph Kocherhans fd20365b27 Fixed #6302. FileField no longer requires a value if one already exists. Thanks Brian Rosner and Øyvind Saltvik.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7021 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-01-17 18:03:21 +00:00
Gary Wilson Jr 4ee22e480e Fixed #6365 -- Added `blank=True` to parent attribute of `m2o_recursive` model example, thanks dgrant.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7015 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-01-13 02:19:06 +00:00
Malcolm Tredinnick 70fe1ef262 Fixed Python 2.3 problem I introduced all the way back in [6852]. :-(
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7000 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-01-06 07:23:21 +00:00
Malcolm Tredinnick a7da12d320 Fixed #5567 -- Added a "last" filter. Based on a patch from darkpixel.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6998 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-01-06 03:53:33 +00:00
Adrian Holovaty 3d52ce730f Reverted 'regroup' template tag changes from [6956], as they caused bug #6271, which affects one of my sites. I don't have time to inspect the #6271 patch, so I'm reverting this change in the interim, to fix the bug immediately.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6996 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-01-05 00:03:12 +00:00
Ian Kelly 6929c0d4d1 Fixed #6254: Made fetchone() in the oracle backend correctly convert
strings to unicode objects.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6995 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-01-04 22:51:22 +00:00
Gary Wilson Jr d6d1188ed0 Middleware regression test fixes:
* Added a models.py file so the tests run.
 * Reset `settings.DEBUG` to `False` at the end of the `test_append_slash_no_redirect_on_POST_in_DEBUG` test so it doesn't bleed over to other tests.
 * Removed unused import.
 * Minor docstring fixes.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6991 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-01-03 02:14:29 +00:00
Adrian Holovaty f6336737a0 Fixed #6291 -- Fixed error in CASocialInsuranceNumberField documentation and error message. Thanks, jeff+django@ivany.org and arien
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6985 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-01-02 05:23:21 +00:00
Adrian Holovaty 293f0f2360 Fixed #6295 -- Made the {% for %} tag a bit more efficient by creating a single context dictionary rather than recreating it each time through the loop. Thanks, Ned Batchelder
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6981 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-01-02 05:01:03 +00:00
Gary Wilson Jr d1b5a0bde5 Removed some reverse string craziness from the regroup template tag argument checking and added a few syntax tests.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6956 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-19 06:11:55 +00:00
Malcolm Tredinnick a35ca605d6 Fixed #5670 -- Changed the validation of the UK postcode widget to allow for easier input. Normalisation still returns the same things as previously. Patch from scott@staplefish.com.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6952 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-19 04:43:47 +00:00
Malcolm Tredinnick 367867845f Fixed #6239 -- Fixed an auto-escaping problem with urlizetrunc. Thanks, SmileyChris.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6950 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-19 04:20:02 +00:00
Malcolm Tredinnick b279b75c87 Fixed #5596 -- Changed the static view for the development server so that Django doesn't crash if somebody tries to serve a 200MB file. Patch from eibaan.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6939 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-17 11:46:48 +00:00
Malcolm Tredinnick 931764ddb5 Fixed #6200 -- Made the core tests independent of the value of LOGIN_URL, since they are sensitive to its setting. Thanks, Jason Yan.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6934 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-17 10:31:20 +00:00
Malcolm Tredinnick 4a25cf5d95 Fixed a Python 2.3 problem from [6927].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6928 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-17 08:50:19 +00:00
Malcolm Tredinnick 03f1eb23e5 Fixed #5956 -- Added a better error description for non-ASCII HTTP headers. Patch from jvloothuis.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6927 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-17 08:05:51 +00:00
Malcolm Tredinnick 1fcb4e4bcd Fixed #5871 -- Factored out the validation errors in localflavor form fields. Brings them into line with the standard newforms fields. Patch from Jan Rademaker.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6926 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-17 08:05:27 +00:00
Joseph Kocherhans 4c59ca6020 Changed ModelForms to allow inheritance as long as their model attributes are the same.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6917 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-13 03:14:31 +00:00
Joseph Kocherhans e415eff0ea Fixed #6162. ModelForm's __init__ signature now matches Form's. This is a backwards incompatbile change. Based largely on a patch by ubernostrum.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6915 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-13 02:48:04 +00:00
Ian Kelly ed5eca598e Fixed ORA-01461 error when trying to store more than 4000 bytes in a TextField under Oracle
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6905 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-11 02:22:40 +00:00
Malcolm Tredinnick 5ed205bc8a Fixed #3906 -- Fixed the reverse_m2m_name for a generic relation. Refs #2749.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6900 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-09 07:12:07 +00:00
Jacob Kaplan-Moss b65fce6595 Fixed #4131: added an "escapejs" filter for use in JavaScript strings, and updated the documentation on addslashes to point to the new ticket. Featuring contributions from Ned Batchelder, Jeremy Dunck, and Andy Durdin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6892 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-04 21:08:29 +00:00
Jacob Kaplan-Moss 76b73ce725 Fixed #5268: the YAML serializer now uses yaml.safe_dump() instead the plain yaml.dump(); this makes YAML dumps more portable, and also removes the crufty '!!python/unicode' business. Thanks, poelzi.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6891 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-04 20:31:34 +00:00
Jacob Kaplan-Moss acfff050ec Fixed #6099: the filebased cache backend now uses md5 hashes of keys instead of sanitized filenames. For good measure, keys are partitioned into subdirectories using the first few bits of the hash. Thanks, sherbang.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6887 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-04 18:03:56 +00:00
Jacob Kaplan-Moss 91ca6f2e7e Fixed #6122: Fixed tests broken by [6872]. Thanks, Matt.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6885 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-04 17:14:32 +00:00
Malcolm Tredinnick 67373009e0 Fixed #4563 -- Context.pop/push/update return the top-level dictionary (the new
one for push() and update(), the one removed for pop()). Based on a patch from
Brian Harring.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6854 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-02 23:57:22 +00:00
Malcolm Tredinnick 1f629bff99 Fixed #3228 -- Added new APPEND_SLASH handling behaviour in the common middleware. Makes customisation a bit easier. Thanks, Mihai Preda and Andy Gayton.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6852 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-02 23:25:55 +00:00
Malcolm Tredinnick 2e62b84acc Fixed #6071 -- Fixed another infinite recursion problem in SafeString and
SafeUnicode. Thanks, Trey Long.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6845 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-02 20:17:10 +00:00
Malcolm Tredinnick 51dc4ecf94 Fixed #6042 -- ModelForms implementation from Joseph Kocherhans. Still might
need a little tweaking as people start to use it, but this is mostly complete.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6844 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-02 19:29:54 +00:00
Malcolm Tredinnick 61947f0635 Fixed #3961 -- Added South African localflavor. Thanks, Russell Cloran.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6843 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-02 18:43:01 +00:00
Malcolm Tredinnick 805c364fcf Fixed #3511 -- Changed QuerySet.get() to return a MultipleObjectsReturned exception, rather than an assertion error. Thanks, Gary Wilson and cheeming.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6838 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-02 18:21:07 +00:00
Malcolm Tredinnick 5e5768ae83 Fixed #3323 -- More robust error handling for related objetcs. Thanks, Greg
Kopka and shaleh.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6835 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-02 18:10:07 +00:00
Gary Wilson Jr 892b04bf21 Fixed a use of `maxlength`, refs #2101.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6824 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-02 01:45:59 +00:00
Gary Wilson Jr 075cfa72ba Removed unused import.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6823 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-02 01:44:58 +00:00
Malcolm Tredinnick f6a3b499b8 Fixed #6086 -- Deprecate the "simple" cache backend in favour of "locmem".
Thanks, Paul Bissex.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6822 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-02 00:35:14 +00:00
Malcolm Tredinnick 348f2cbfc1 Fixed #5996 -- Add a pyscopg2 convertor for SafeUnicode -> unicode. Thanks, remco@diji.biz
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6816 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-01 22:26:24 +00:00
Malcolm Tredinnick b3db18817a Fixed #5979 -- Always use SITE_ID=1 when running Django's core tests. This
makes things much easier. Thanks, George Vilches.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6814 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-01 21:58:51 +00:00
Malcolm Tredinnick a72324bf7f Fixed #6068 -- Updated docstrings in model tests to make the documentation
examples correct.  Thanks Wang Chun.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6813 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-01 21:18:45 +00:00
Malcolm Tredinnick 8de4ed9c8c Fixed #6057 -- Mark rendered template output as safe for auto-escaping purposes.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6778 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-30 15:32:01 +00:00
Malcolm Tredinnick 5d1d054e15 Fixed #6030 -- More robust error handling for the "float" filter. Thanks,
SmileyChris.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6752 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-29 20:10:00 +00:00
Malcolm Tredinnick caa0523cb8 Fixed #6050 -- Handled edge-case of duplicate keys being passed when
initialising SortedDict. Patch from Collin Grady and SmileyChris.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6751 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-29 20:09:54 +00:00
Malcolm Tredinnick f3c15225fc Fixed #6023 -- Fixed daylight savings determination for years beyond 2038 on
32-bit systems (modulo the fact that the system timezone libraries might not be
accurate that far out; at least we don't crash now). Thanks, SmileyChris.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6749 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-29 19:39:46 +00:00
Malcolm Tredinnick 260f9c5112 Fixed #5989 -- Fixed a problem with values being incorrectly reused by
reference in field subclassing. Thanks, flupke.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6748 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-29 19:30:49 +00:00
Malcolm Tredinnick 29892d02fa Fixed #6014 -- More robust error handling when validating decimal fields.
Thanks, pigletto.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6746 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-29 19:30:38 +00:00
Malcolm Tredinnick 7a166f1a1c Fixed #5959 -- Fixed handling of False values in hidden boolean fields. Thanks,
SmileyChris.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6745 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-29 19:22:03 +00:00
Malcolm Tredinnick 4cbc8c62cf Fixed #5939 -- Added normalization for New Brunswick in the Canadian provinces.
Thanks, rajesh.dhawan@gmail.com.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6744 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-29 18:15:46 +00:00
Malcolm Tredinnick d0f5a58fbd Fixed #4653 -- Improved the logic to decide when to include (and select as
initial value) the blank choice for a model field with choices. Thanks to
Ilya Semenov for persisting with this.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6733 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-29 16:32:18 +00:00
Malcolm Tredinnick b6002d4af6 Fixed #1291 -- Fixed a potential infinite loop for some URL constructions in
the development server. Thanks, Graham Carlyle.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6731 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-29 15:47:47 +00:00
Malcolm Tredinnick 3c272792d6 Added tests and a small optimisation for [6721]. Thanks SmileyChris. Fixed #6049
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6729 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-29 01:44:30 +00:00
Malcolm Tredinnick 9130765ff9 Fixed #5890 -- fixed the far edge-case of allowing constant strings inside
template template markers: we now treat embedded, escaped double quotes
consistently with constant string arguments to filters. Patch from Dmitri
Fedortchenko.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6724 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-28 21:04:05 +00:00
Malcolm Tredinnick 1c87a7bb58 Fixed #5730: Conditionally escape widget contents in newforms to avoid
inadvertent double-escaping. This still isn't perfect behaviour (since it's
unaware of the current context's auto-escaping setting), but that's a larger
problem that needs fixing and this change at least makes the existing
behaviour consistent. Patch from SmileyChris.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6722 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-28 20:19:54 +00:00
Gary Wilson Jr f110da91db Fixed #5993 -- Made `RadioSelect` easier to subclass by giving it a default `renderer` as a class attribute.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6717 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-26 02:39:48 +00:00
Gary Wilson Jr 5903b0bdcd Added a few more tests for `MultiValueDict`.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6715 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-25 18:16:40 +00:00
Malcolm Tredinnick 2e9e36e297 Fixed #5983 -- Made iriencode filter respect safe strings. Patch from
SmileyChris.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6706 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-20 01:37:57 +00:00
Gary Wilson Jr 6522e0697a Fixed #5932 -- Use `self.pages` and not `self._pages` in `_get_page_range` so that an exception is not raised if `self.page_range` is accessed before `self.pages`.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6702 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-19 06:10:23 +00:00
Gary Wilson Jr 34cc21983c Removed `vary_delim_re` in `django/utils/cache.py` in favor of existing `cc_delim_re` since the latter is more correct in parsing the header (allows whitespace before and after comma separators instead of just after). As a bonus, tests added for `patch_vary_headers()`.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6696 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-19 03:12:19 +00:00
Gary Wilson Jr b2b6fc8e3c Fixed #5975 -- Gave `ModelChoiceField` and `ModelMultipleChoiceField` ability to specify custom error messages.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6694 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-18 20:25:23 +00:00
Malcolm Tredinnick 5f8cfe99f3 Fixed #5969 -- Corrected a problem introduced in [6682].
*sigh* As usual, the one case I forget to test turned out to be broken.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6689 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-18 03:36:03 +00:00
Malcolm Tredinnick 4bd75e8712 Fixed a couple of chained filter tests that weren't demonstrating what they
claimed (since the "cut" filter's behaviour had changed since I originally
wrote those tests).


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6684 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-17 12:18:09 +00:00
Malcolm Tredinnick 4585b4d6c2 Fixed some missed auto-escaping and URL quoting cases in the urlize filter.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6683 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-17 12:12:40 +00:00
Malcolm Tredinnick adcec0885d Fixed a few problems with variable resolving inside of blocktrans tags. A couple of these were exposed by the auto-escaping changes, but I suspect the other one has been hiding in plain sight for a while.
Fixed #5952, #5953


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6682 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-17 12:12:18 +00:00
Malcolm Tredinnick 64c0bf8677 Translating safe strings should return a safe result.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6681 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-17 12:11:54 +00:00
Malcolm Tredinnick 0928fa5566 Fixed #5945 -- Treat string literals in template filter arguments as safe
strings for auto-escaping purposes.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6680 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-17 12:11:26 +00:00
Malcolm Tredinnick 0b0ef3f0c5 Fixed #4713 -- Fixed handling of _() in template tag arguments. Based on
patched from Indy and SmileyChris.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6679 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-17 04:04:12 +00:00
Malcolm Tredinnick bdb0b903c2 Content coming via {{ block.super }} is always going to be correctly escaped
already. We mark it as safe so that template authors don't need to.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6673 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-14 21:07:27 +00:00
Malcolm Tredinnick 356662cf74 Implemented auto-escaping of variable output in templates. Fully controllable by template authors and it's possible to write filters and templates that simulataneously work in both auto-escaped and non-auto-escaped environments if you need to. Fixed #2359
See documentation in templates.txt and templates_python.txt for how everything
works.

Backwards incompatible if you're inserting raw HTML output via template variables.

Based on an original design from Simon Willison and with debugging help from Michael Radziej.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6671 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-14 12:58:53 +00:00
Gary Wilson Jr babfe78494 Fixed #4787, #5913 -- Updating the queryset on a `ModelChoiceField` or `ModelMultipleChoiceField` now updates its widget's choices. The clean methods for `ModelChoiceField` and `ModelMultipleChoiceField` were changed to only allow choices in the specified queryset (instead of allowing all choices returned by the queryset model's default manager).
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6670 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-13 14:36:29 +00:00
Malcolm Tredinnick 3ee3d6b5f3 Fixed #5898 -- Changed a few response processing paths to make things harder to get wrong and easier to get right. Previous behaviour wasn't buggy, but it was harder to use than necessary.
We now have automatic HEAD processing always (previously required ConditionalGetMiddleware), middleware benefits from the Location header rewrite, so they can use relative URLs as well, and responses with response codes 1xx, 204 or 304 will always have their content removed, in accordance with the HTTP spec (so it's much harder to indavertently deliver invalid responses).

Based on a patch and diagnosis from regexbot@gmail.com.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6662 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-11 03:55:44 +00:00
Malcolm Tredinnick 30848dfe34 When using assertRedirect(), allow the caller to specify relative URLs and
automatically fill in the hostname and scheme (host can be passed in, if
different from the default).


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6661 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-11 03:54:21 +00:00
Gary Wilson Jr 1eecc5a47e Corrected a couple comments in `model_forms` tests.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6660 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-09 19:35:56 +00:00
Luke Plant 8eeb9feab0 Fixed #4376 -- login_required now works with bound methods. Thanks, Steven Bethard.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6658 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-07 22:45:07 +00:00
Malcolm Tredinnick ea100b607a Added the small changes necessary to make creating custom model fields easier.
Also includes some tests for this.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6651 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-05 13:59:42 +00:00
Gary Wilson Jr a5eb61cd9f Added tests for `floatformat` template filter for number with non-zero decimal place digit and ending in zeros.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6647 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-04 02:32:02 +00:00
Malcolm Tredinnick 77a846bab0 Fixed a Python 2.3 problem.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6644 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-04 02:08:15 +00:00
Gary Wilson Jr 8c442f21dc Fixed #5816 -- Fixed a regression from [6333] that generates incorrect cookie "expires" dates when using a locale other than English. Introduced `http_date` and `cookie_date` utility functions. Thanks for the report Michael Lemaire. Thanks for the patch Karen Tracey and `SmileyChris`.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6634 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-31 03:59:40 +00:00
Gary Wilson Jr 26ea06b0ab Fixed #3457 -- Allow overridding of error messages for newforms Fields.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6625 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-28 05:40:26 +00:00
Malcolm Tredinnick 1580630fbd Removed an "XFAIL" marker that was accidentally hanging around since the
unicode branch days.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6619 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-27 06:23:19 +00:00
Malcolm Tredinnick 91556cf22e Fixed an invalid URL specification.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6618 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-27 06:23:05 +00:00
Jacob Kaplan-Moss a14256aade Committed missing file from [6608].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6612 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-26 20:08:56 +00:00
Jacob Kaplan-Moss 842a771e05 i18n security fix. Details will be posted shortly to the Django mailing lists and the official weblog.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6608 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-26 19:52:42 +00:00
Matt Boersma 2c22f08657 Changed field to "def_date" from "date" in new tests from [6568] so we can run the test suite against Oracle again. Refs #4140.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6595 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-22 22:04:00 +00:00
Malcolm Tredinnick 003b3c1a17 Fixed #5794 -- Be more robust when rendering a DateTimeInput widget. Thanks,
MikeH.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6594 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-22 13:13:12 +00:00
Malcolm Tredinnick dbd1cb9083 Fixed #5183 -- Added __deepcopy__, pop() and popitem() to SortedDict. Based on
a patch from David Blewett.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6593 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-22 00:52:54 +00:00
Malcolm Tredinnick 8e87587e89 Fixed #3265 -- Made it a validation error to have field names with trailing
underscores. Allowing these would enable peopleto write ambiguous queryset
filters (plus makes parsing filters much harder).


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6590 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-21 21:53:18 +00:00
Malcolm Tredinnick 3ec6568e64 Modified the test harness to respect the LANGUAGE_CODE setting. Also changed
Django's own test runner to always use 'en' for LANGUAGE_CODE when testing
core. Fixed #4709


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6583 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-21 17:26:32 +00:00
Malcolm Tredinnick 7ca708140a Fixed #2920 -- Removed _() from builtins.
This is backwards incompatible, but easy to work around.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6582 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-21 17:14:25 +00:00
Malcolm Tredinnick 6fbf653aa5 Fixed #1065 -- Added a "cache" template tag. Thanks, Ian Maurer and, particularly, Nick Lane.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6580 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-21 15:48:40 +00:00
Malcolm Tredinnick 1671fc48ab Changed the default form presentation of datetime values to not include the
fractional second values (they usually aren't going to be needed). Based on
patches from yi.codeplayer@gmail.com, andrews and Wiliam Alves de Souza. Fixed #4428, #4487


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6578 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-21 14:50:47 +00:00
Malcolm Tredinnick 714c09b8bd Fixed #4831 -- Added an "add" cache key method, for parity with memcached's
API. This works for all cache backends. Patch from Matt McClanahan.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6572 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-20 15:16:34 +00:00
Malcolm Tredinnick b678601df3 Fixed #4123 -- Changed the firstof template tag to correctly handle a literal
string as its last argument. Thanks, Wesley Fok and Matt Boersma.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6571 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-20 15:01:31 +00:00
Malcolm Tredinnick 18e1f56a41 Fixed #5475 -- Added the Luhn check algorithm to django.utils.checksums so that
localflavors don't have to reimplement it each time. Thanks, __hawkeye__.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6569 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-20 13:40:20 +00:00
Malcolm Tredinnick f20b254ccc Fixed #899 -- Use model field default values as formfield initial values in
form_for_model(). Patch from David Danier and PhiR. Thanks.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6568 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-20 13:01:40 +00:00
Malcolm Tredinnick e38d54e19a Changed newforms.CheckboxInput widget to return False as its value when not
include in the form (since HTML form submission doesn't send unselected check
boxes). Patch from SmileyChris. Refs #5104.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6563 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-20 12:21:07 +00:00
Malcolm Tredinnick 8db11840d3 Fixed #5200 -- Added some more functionality to the Polish localflavor. Thanks,
Slawek Mikula.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6556 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-20 09:24:19 +00:00
Malcolm Tredinnick aac5555f2f Fixed #4036 -- Added Spanish localflavor. Thanks, ricardojbarrios@gmail.com and
oggie_rob.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6555 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-20 09:16:54 +00:00
Malcolm Tredinnick bece031772 Fixed #5734 -- Fixed an omission where we weren't passing the "safe" argument
upstream in django.utils.http.urlquote(). Thanks, Thomas Güttler.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6554 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-20 08:38:59 +00:00
Malcolm Tredinnick cb38521487 Changed the auth_backend tests in a cosmteic fashion so that they pass under Python 2.3 as well.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6552 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-20 08:15:42 +00:00
Gary Wilson Jr 78d557bf02 Fixed #5744 -- Allowed SortedDict contructor to be passed a list of tuples to match the interface of dict, thanks Thomas Güttler.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6506 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-14 04:17:02 +00:00
Malcolm Tredinnick 185848a526 Fixed #5641 -- Handle lazy translations correctly when used as default arguments. Thanks, permon.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6453 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-04 01:55:51 +00:00
Malcolm Tredinnick fa546d797e Fixed #4796. Fixed a problem when using i18n support for the first time -- in
particular when string_concat() was the first call made. Thanks, Andy Durdin.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6446 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-03 01:57:02 +00:00
Jacob Kaplan-Moss 960c1263b6 Fixed #5559: instances sent via post-save signals no longer have pks of None. Thanks, Joseph Kocherhans.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6411 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-24 18:27:42 +00:00
Russell Keith-Magee 2d1d7e453c Fixed generic view test which was failing on Postgres and MySQL.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6407 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-22 15:14:41 +00:00
Russell Keith-Magee f2101abacf Fixed #5553 -- Fixed a serialization problem with datetime and time objects. Thanks to pigletto for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6406 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-22 13:21:54 +00:00
Russell Keith-Magee 302eeaf190 Fixed #5516 -- Added the ability for applications to define their own management commands. Pieces of this patch taken from a contribution by Todd O'Bryan. Thanks Todd.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6400 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-21 16:19:20 +00:00
Jacob Kaplan-Moss 484189ff9c Fixed httpwrappers tests broken by [6385].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6396 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-20 15:51:19 +00:00
Jacob Kaplan-Moss 7768fe3505 Removed empty tests/regressiontests/forms/localflavor.py file left over after [6379]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6380 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-20 00:24:42 +00:00
Jacob Kaplan-Moss 35fa1f4d8e Fixed #5546: split form unit tests into manageable chunks. This isn't a perfect fix since the chunks aren't yet autodiscovered, but that shouldn't prevent checking this in. Thanks, Leo Soto.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6379 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-19 23:40:47 +00:00
Jacob Kaplan-Moss 980fa8b827 Fixed #231: all fields that should take max_length now do. Thanks, Don Spaulding.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6378 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-19 23:33:57 +00:00
Jacob Kaplan-Moss f857e37776 Fixed $5457 - the auth system now delegates permission checking to auth backend(s). As an added bonus, the auth backends now have some unit tests! Thanks, Florian Apolloner.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6375 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-19 16:50:30 +00:00
Russell Keith-Magee 466871ec1b Fixed #5506 -- Added some basic tests for date-based generic views. Thanks to robh for the original patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6374 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-19 13:26:56 +00:00
Russell Keith-Magee 1571e9c32b Fixed #5496 -- Added test cases for some of the built-in Django views. Thanks to Manuel Saelices <msaelices@yaco.es> for the original patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6370 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-17 14:48:33 +00:00
Gary Wilson Jr 66203fc9ee Fixed #2675 -- Changed the `timeuntil` and `timesince` template filters to display "0 minutes" when passed a past or future date respectively instead of "-1 years, 12 months". Thanks to nickefford for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6366 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-17 04:50:12 +00:00
Malcolm Tredinnick c012b8964e Fixed #4067 -- Fixed validation of IPAddressFields in newforms. Thanks to neils and the team in the Copenhagen sprint group.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6357 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-16 11:38:32 +00:00
Malcolm Tredinnick e988aa3989 Fixed a typo. I think I should get full marks for getting all the letters right, but some people insist they should be in the right order, too.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6355 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-16 10:49:27 +00:00
Malcolm Tredinnick 7a6e9f7633 Rewrote the backends test to be more portable. Was previously failing on MySQL.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6354 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-16 10:04:26 +00:00
Malcolm Tredinnick 14754fa6d4 Removed the test portion that relies on transactions when the backend is mysql or mysql_old (it's still in place for all other backends).
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6353 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-16 10:04:03 +00:00
Malcolm Tredinnick 748e55b1da Fixed #4975 -- Allow the default label suffix character to be configured. Thanks, Vincent Foley.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6352 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-16 04:38:20 +00:00
Malcolm Tredinnick e2409750f8 Fixed #3703 -- Added pk property to models. Thanks, Collin Grady and jeromie@gmail.com.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6346 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-16 01:57:25 +00:00
Malcolm Tredinnick 885db3cb79 Fixed #5355 -- Fixed data cleaning for DecimalField.
In passing, fixed a problem with cleaning in IntegerField.

Includes tests from PhiR.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6282 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15 11:45:19 +00:00
Malcolm Tredinnick 39814eeb54 Fixed #5487 -- Added deepcopying ability to lazy() objects, along with a test to demonstrate why the previous code failed. Debugging and patch from John Buchanan.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6276 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15 10:57:03 +00:00
Malcolm Tredinnick f0cd172cd0 Fixed #5387 -- Added is_multipart method to forms. Original patch from Petr Marhhoun. Tests and documentation from Murkt.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6273 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15 10:12:05 +00:00
Malcolm Tredinnick 1baae32e16 Fixed #4879 -- Added 'created' arg to post_save signal. This is True is a new object is created. Patch from George Vilches.
Fully backwards compatible, because signal receivers do not have to be able to accept all the arguments (thankyou, robust_apply()).


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6269 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15 09:14:51 +00:00
Russell Keith-Magee 314536190b Fixed #4714 -- Modified serializers to handle None primary keys correctly. This slightly changes the output format for primary keys on JSON and YAML serializers (PKs will be output as 1, rather than "1". However, fixtures in the old format will still load ok. Thanks for the patch, pigletto.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6264 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15 05:32:29 +00:00
Russell Keith-Magee cf3c94b26d Fixed #4415 -- Added formfield method to PositiveIntegerField, so that those fields get validated correctly. Thanks, Oggie Rob.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6252 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15 02:37:07 +00:00
Ian Kelly c74ebab686 Added explicit order_by filters to some model_forms tests that were failing in Oracle due to returning results in the wrong order.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6250 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15 00:19:22 +00:00
Ian Kelly ad821b6459 Made the fixtures_regress test case be aware of Oracle's empty string
limitations.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6249 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15 00:08:08 +00:00
Matt Boersma 6c16d84a0b Fixed test case that failed on Oracle because it assumed an ordering for
objects.all().


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6246 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 23:09:05 +00:00
Jacob Kaplan-Moss 5af2af3e33 Fixed the test in [6218] which was invalid for psycopg2 and friends -- executemany() shouldn't accept None, just empty lists.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6242 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 22:54:58 +00:00
Ian Kelly 5a5d8a90b5 Added test cases for [6218].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6220 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 21:38:45 +00:00
Jacob Kaplan-Moss 525af7d580 Fixed #4542: added a generic localflavor DateField. Thanks, Nick Lane.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6208 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 19:28:26 +00:00
Adrian Holovaty 55d6aebfec Fixed #5394 -- REDIRECT_FIELD_NAME is now configurable. Thanks, Petr Marhoun, DavidReynolds and effbot
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6206 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 19:25:37 +00:00
Jacob Kaplan-Moss 7e4da4e66d Fixed #3988: added a localflavor for our friends to the north (i.e. Canada). THanks, Tyler Tarabula.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6202 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 19:02:05 +00:00
Jacob Kaplan-Moss eea935a7f4 Fixed #5448: you can now use unicode characters in primary keys. Thanks, pigletto.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6200 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 18:36:04 +00:00
Ian Kelly 93f60163e8 Fixed #5218: Made Oracle create autoinc triggers using the correct name
of the AutoField column rather than always assume "ID".


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6195 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 18:12:36 +00:00
Malcolm Tredinnick b7df720839 Fixed #5453 -- Fixed TEST_DATABASE_NAME handling to match documentation. Thanks, Matt Croydon.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6186 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 12:48:10 +00:00
Malcolm Tredinnick ea3e89cb1d Fixed a bunch of Python 2.3 issues. Two tests still fail, but this fixes the bulk of things.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6183 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 09:55:17 +00:00
Malcolm Tredinnick 5188a18dbe Fixed #4964 -- Added Brazilian state field to localflavors. Thanks, William Alves de Souza.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6176 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 07:19:38 +00:00
Russell Keith-Magee 20ecbbd9e7 Fiex #5331 -- Modified newforms URLField to prepend http:// if no protocol is specified by the user. Thanks, SmileyChris.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6173 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 07:02:55 +00:00
Malcolm Tredinnick eabb57f6f0 Fixed tests to match new HTTP redirect behaviour. We always redirect to absolute URLs now.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6169 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 06:05:54 +00:00
Malcolm Tredinnick e70d7e6064 Fixed #987 -- Convert relative URI portions into absolute URIs in HTTP Location headers. Based on a patch from SmileyChris.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6164 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 05:28:00 +00:00
Malcolm Tredinnick 70e5dce365 Fixed #3489 -- Added proper deepcopying to form fields so that widget instances get copied as well. Patch from Jonathan Buchanan and insin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6156 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 03:29:39 +00:00
Russell Keith-Magee 09145d2e5f Fixed #208 -- Modernized the syntax of the cycle tag to allow for spaces and variables in cycle values. Thanks to SmileyChris and Chris McAvoy for their work on this.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6153 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 02:49:21 +00:00
Russell Keith-Magee a2ce7669d9 Fixed #3421 -- Added IP and localhost validation to newforms URLField. Thanks, SmileyChris.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6152 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 02:11:24 +00:00
Gary Wilson Jr 8b0eaba0ee Moved `flatatt` function tests to the util test module.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6151 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 02:05:45 +00:00
Gary Wilson Jr 0b1f4e3c7b Refs #5370 -- Added tests for ValidationError messages.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6150 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 02:01:11 +00:00
Russell Keith-Magee 87e77ffca0 Fixed #1795 -- Added page_range to paginators in generic list views. Thanks to polarcowz@gmail.com and Marc Fargas <telenieko@telenieko.com> for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6146 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 01:01:02 +00:00
Malcolm Tredinnick cb9db44938 Fixed #5431 -- Added Argentinean localflavor. Thanks, Ramiro Morales.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6145 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14 00:58:57 +00:00
Malcolm Tredinnick ce249d4366 Fixed #4752 -- Make default ErrorList customisable in newforms display. Based on a patch from michal@logix.cz and SmileyChris.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6142 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-13 23:09:40 +00:00
Malcolm Tredinnick a9fd677cb3 Fixed #5403 -- Added Dutch localflavor. Thanks, Jan Rademaker.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6139 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-13 22:16:59 +00:00
Gary Wilson Jr aacb0cf055 Removed duplicate form tests added in the [changeset:5609 unicode merge].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6090 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-11 04:21:32 +00:00
Gary Wilson Jr 7e57576ff7 Fixed #5232 -- Fixed the validation of `DecimalField` so that the negative sign is not counted as a digit. Thanks, Andrew Durdin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6067 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-08 19:24:46 +00:00
Gary Wilson Jr 41b3a45fc5 Fixed #3557 -- Made `SlugField` inherit from `CharField` so that its `max_length` is properly set. Removed `get_manipulator_field_objs` method since it's already provided by `CharField`. Thanks, Russell Cloran.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6065 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-08 05:09:39 +00:00
Gary Wilson Jr 4e476b44af Removed trailing whitespace.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6046 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-04 00:54:40 +00:00
Gary Wilson Jr 2292ebb47f Removed import that snuck into [6044].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6045 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-04 00:53:59 +00:00
Gary Wilson Jr 53372fcb07 Cleaned up some imports.
Fixed long lines.
Changed some docstrings to use "action words".


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6044 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-04 00:50:06 +00:00
Gary Wilson Jr 1da7b5cde7 Added test for unknown non-field error.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6043 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-04 00:48:19 +00:00
Russell Keith-Magee d1d4d018bf Fixed #5330 -- Added a fixture file that was missing from [6039].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6042 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-03 23:41:24 +00:00
Gary Wilson Jr bce7de9647 Removed some duplication in the Django `TestCase` methods by introducing a `to_list` function for putting a value into a list if it's not already one.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6041 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-03 23:14:51 +00:00
Russell Keith-Magee 3bf4ef0c77 Fixed #4988 -- In the test client, Added tracking of the client and request that caused a response so that the assertRedirects check can use the correct client when following a redirect. Well spotted, alex@gc-web.de.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6039 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-03 11:21:40 +00:00
Russell Keith-Magee 5ad08583e1 Fixed #4968 -- Added assertRedirects handling for paths with GET data. Thanks for the patch, Ivan Sagalaev.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6031 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-31 11:37:28 +00:00
Gary Wilson Jr 1a1a58c9f8 Fixed #3184 -- Changed the `unordered_list` template filter to use a more simple format, while maintaining backwards compatibility with the old format. `unordered_list` now works with a simple list of items. Thanks for the patch, SmileyChris.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6019 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-26 01:11:20 +00:00
Malcolm Tredinnick 14b5e074ba Fixed #3311 -- Added naturalday filter to contrib.humanize. Thanks, Jyrki Pulliainen.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5985 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-20 08:50:08 +00:00
Malcolm Tredinnick 7e8efcd4d9 Fixed #5087 -- Fixed support for TextField filtering with Oracle. Thanks, Ian Kelly.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5943 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-19 12:37:00 +00:00
Malcolm Tredinnick 90c177f18e Fixed #5200 -- Added Polish localflavor. Thanks, Slawek Mikula.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5936 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-19 07:38:39 +00:00
Russell Keith-Magee 103fe15efc Added docstring to logout test case.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5917 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-17 14:42:25 +00:00
Russell Keith-Magee 8dff1cd91d Fixed #5189 -- Added logout method to test Client. Thanks, Jakub Wisniowski <restless.being@gmail.com>.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5916 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-17 14:20:25 +00:00
Russell Keith-Magee 55c0b35acf Minor fix to get the fixure model test to pass in the new management framework.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5915 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-17 14:02:40 +00:00
Malcolm Tredinnick fc041a3c1c Made output for invalid model tests more consistent (removed colored output).
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5914 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-17 12:29:08 +00:00
Adrian Holovaty 01adbb55e6 Major refactoring of django.core.management -- it's now a package rather than a 1730-line single module. All django-admin/manage.py commands are now stored in separate modules. This is backwards-incompatible for people who used django.core.management functions directly
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5898 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-16 06:06:55 +00:00
Malcolm Tredinnick 4bf3680dfa If SITE_ID isn't in the test settings, fake it. We need the sites framework, but the value of SITE_ID is currently unimportant, so we can transparently fix this error.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5893 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-15 11:29:58 +00:00
Malcolm Tredinnick ba29b7a97b Reverted [5887], at least for now. Both flatpages and redirects depend on the
sites app.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5892 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-15 11:25:22 +00:00
Adrian Holovaty 69cf1bb460 Removed django.contrib.sites from ALWAYS_INSTALLED_APPS in runtests.py. It was causing a test error for people who don't have SITE_ID set, and none of the tests required it, anyway
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5887 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-14 22:30:42 +00:00
Malcolm Tredinnick 3757f30c99 Fixed #4947 -- Avoid displaying uploaded file contents in the debug web page. Based on a patch from eibaan@gmail.com.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5874 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-12 12:02:08 +00:00
Malcolm Tredinnick 36be3febef Fixed #4622 -- Fixed SelectDateWidget to work correctly when used as a hidden input field. Thanks, Bill Fenner.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5859 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-12 02:15:35 +00:00
Malcolm Tredinnick 31ba14761e Fixed #5134 -- Return empty strings as Unicode in psycopg1 backend.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5834 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-11 05:23:19 +00:00
Gary Wilson Jr 049212e950 Fixed #5115 -- Fixed `QuerySet` slices to allow longs.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5831 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-08 21:09:55 +00:00
Russell Keith-Magee fbd1a6277e Fixed #3297 -- Implemented FileField and ImageField for newforms. Thanks to the many users that contributed to and tested this patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5819 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-06 13:58:56 +00:00
Russell Keith-Magee f96e933534 Fixed #4001 -- Added dynamic save_m2m method() to forms created with form_for_model and form_for_instance on save(commit=False).
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5804 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-05 07:39:36 +00:00
Gary Wilson Jr 212ee65be7 Fixed #2101 -- Renamed `maxlength` argument to `max_length` for oldforms `FormField`s and db model `Field`s. This is fully backwards compatible at the moment since the legacy `maxlength` argument is still supported. Using `maxlength` will, however, issue a `PendingDeprecationWarning` when used.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5803 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-05 05:14:46 +00:00
Gary Wilson Jr cdbd5751d3 Fixed #4228 -- Removed hardcoding of `RadioFieldRenderer` in the `RadioSelect` Widget so that the display of `RadioSelect`s can be more easily customized. `BoundField.__unicode__` also no longer special cases `RadioSelect` since `RadioSelect.render()` now returns a string like every other Widget.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5782 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-01 05:41:32 +00:00
Gary Wilson Jr f27774ee0a Fixed call to `ugettext`, which is imported as `_`.
Changed raise to conform to PEP 3109 and wrapped the long line.
Added beginnings of tests for model fields.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5778 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-30 17:25:35 +00:00
Russell Keith-Magee 650cea9170 Fixed #4460 -- Added the ability to be more specific in the test cases that are executed. This is a backwards incompatible change for any user with a custom test runner. See the wiki for details.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5769 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-28 04:02:52 +00:00
Adrian Holovaty 8831f3ee2c Added unit test that confirms a bug in ValuesQuerySets that have extra(select) specified. If the select dictionary has several fields, Django assigns the wrong values to the select-field names
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5767 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-27 21:53:02 +00:00
Russell Keith-Magee 1b7fe09660 Fixed #3771 -- Modified the test runner to observe the --noinput argument controlling script interactivity. This means that test scripts can now be put in a buildbot environment. This is a backwards incompatible change for anyone that has written a custom test runner. Thanks for the suggestion, moof@metamoof.net.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5752 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-23 12:14:32 +00:00
Gary Wilson Jr 304381616f Fixed #4952 -- Fixed the `get_template_sources` functions of the `app_directories` and `filesystem` template loaders to not return paths outside of given template directories. Both functions now make use of a new `safe_join` utility function. Thanks to SmileyChris for help with the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5750 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-23 04:45:01 +00:00
Gary Wilson Jr cae92ae615 Fixed #4373 -- Modified the get_object_or_404/get_list_or_404 shortcuts to also accept `QuerySet`s. Thanks SuperJared.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5746 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-22 03:41:11 +00:00
Russell Keith-Magee f2303b6f7a Fixed #4402 -- Modified test client to allow multi-valued inputs on GET requests. Thanks for the suggestion, eddymul@gmail.com.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5741 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-21 05:17:20 +00:00
Russell Keith-Magee 6a4f164a6f Added test cases for change [5739].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5740 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-21 05:15:19 +00:00
Adrian Holovaty 07dd6b2895 Fixed negligible typo in docstring in tests/regressiontests/test_client_regress/models.py from [5731]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5733 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-20 15:40:54 +00:00
Russell Keith-Magee 56394220d5 Fixed #4901 -- Modified assertContains to provide a default check of 'any instances of text in content'. Thanks for the suggestion, nis@superlativ.dk.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5731 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-20 14:32:20 +00:00
Russell Keith-Magee 9922a04bb6 Fixed #3782 -- Added support for the suite() method recommended by the Python unittest docs. Thanks for the suggestion, rene.puls@repro-mayr.de.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5729 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-20 13:57:49 +00:00
Russell Keith-Magee 73bec372ee Fixed #4897 -- Fixed minor typo in doctest comment.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5728 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-20 12:15:02 +00:00
Russell Keith-Magee 3fef1f4c8d Fixed #4558 -- Modified XML serializer to handle whitespace better around None tags. Thanks to Bill Fenner <fenner@gmail.com> for the report and fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5727 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-20 12:07:58 +00:00
Malcolm Tredinnick f5ef3bec68 Fixed #3925 -- Added Slovak localflavor items. Thanks, Martin Kosír.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5724 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-19 09:24:36 +00:00
Malcolm Tredinnick 2679bc0304 Fixed #4845 -- Fixed some problems with Unicode usage and caching. Thanks,
Jeremy Dunck.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5718 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-16 09:36:10 +00:00
Gary Wilson Jr f6ced03321 Refs #3012 -- Removed iterator from `test_data_types` cache test that I added in [5703]. Iterators cannot be pickled either. Left the rest of [5703] there though since it fixed another issue that was causing the `test_data_types` cache test to fail with the `locmem` cache backend, the fact that functions cannot be copied.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5716 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-16 05:00:18 +00:00
Gary Wilson Jr ae7f04caab Fixed #3012 -- Changed the locmem cache backend to use pickle instead of deepcopy to make it compatible with iterators (which cannot be copied). Patch from Sundance.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5703 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-15 06:24:54 +00:00
Gary Wilson Jr b68f188628 Fixed #4310 -- Fixed a regular expression bug in `strip_entities` function and added tests for several `django.utils.html` functions. Based on patch from Brian Harring.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5701 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-15 05:03:28 +00:00
Malcolm Tredinnick f9d27b5d0b Fixed #4870 -- Removed unneeded import and fixed a docstring in an example.
Thanks, Collin Grady.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5697 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-14 14:50:35 +00:00
Malcolm Tredinnick 40bb32b5a4 Fixed #4469 -- Added slightly more informative error messages to max- and
min-length newform validation. Based on a patch from A. Murat Eren.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5686 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-13 14:13:35 +00:00
Malcolm Tredinnick 92f54aff7a Fixed #4807 -- Fixed a couple of corner cases in decimal form input validation.
Based on a suggestion from Chriss Moffit.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5680 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-13 09:09:59 +00:00
Russell Keith-Magee b8d0dc73c7 Fixed #4526 -- Modified the test Client login method to fail when a user is inactive. Thanks, marcin@elksoft.pl.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5677 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-12 15:26:37 +00:00
Russell Keith-Magee f3e71048c3 Fixed #4808 -- Added Chilean regions in localflavor. Thanks, Marijn Vriens <marijn@metronomo.cl>.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5663 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-12 12:44:05 +00:00
Russell Keith-Magee 81d313c9b1 Fixed #3768 -- Disabled NullBooleanField PK serialization test. We can't and don't test null PK values.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5660 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-12 11:27:38 +00:00
Russell Keith-Magee 7a198f5105 Fixed #3770 -- Remove null=True tag from OneToOne serialization test. OneToOne fields can't have a value of null.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5659 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-12 11:24:16 +00:00
Russell Keith-Magee 2d6d20def7 Fixed #4459 -- Added 'raw' argument to save method, to override any pre-save processing, and modified serializers to use a raw-save. This enables serialization of DateFields with auto_now/auto_now_add. Also modified serializers to invoke save() directly on the model baseclass, to avoid any (potentially order-dependent, data modifying) behavior in a custom save() method.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5658 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-12 07:45:35 +00:00
Malcolm Tredinnick 87d8976fae Fixed #4804 -- Fixed a problem when validating choice lists with non-ASCII
data. Thanks, django@vonposer.de.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5642 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-10 12:03:36 +00:00
Malcolm Tredinnick 8c85ddf306 Fixed #4772 -- Fixed reverse URL creation to work with non-ASCII arguments.
Also included a test for non-ASCII strings in URL patterns, although that
already worked correctly.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5630 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-07 18:24:27 +00:00
Gary Wilson Jr 0816f380d2 Fixed #4779 -- Fixed a couple typos in the `test_client_regress` tests that surfaced when typo was corrected in [5620]. Thanks ferringb@gmail.com.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5621 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-06 04:04:42 +00:00
Malcolm Tredinnick d0b627acc2 Added a test that shows the problem in #4470. This fails only for the mysql_old
backend. Refs #4470.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5617 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-05 10:27:22 +00:00
Malcolm Tredinnick 953badbea5 Merged Unicode branch into trunk (r4952:5608). This should be fully
backwards compatible for all practical purposes.

Fixed #2391, #2489, #2996, #3322, #3344, #3370, #3406, #3432, #3454, #3492, #3582, #3690, #3878, #3891, #3937, #4039, #4141, #4227, #4286, #4291, #4300, #4452, #4702


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5609 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-04 12:11:04 +00:00
Malcolm Tredinnick 3a892122f2 Made the reg-exp lookup tests more robust. they now pass for all database
backends and are not dependent on locale sorting order.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5579 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-01 04:47:46 +00:00
Jacob Kaplan-Moss 24512a74be Fixed #1465: added support for regex lookups. Thanks, Tom Tobin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5555 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-27 18:58:10 +00:00
Malcolm Tredinnick a5802b35dd Fixed #4453 -- Allow dots in URL pattern names (although the string in that case is first tried as an import path and only then falls back to being treated as a pattern).
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5530 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-25 04:34:34 +00:00
Malcolm Tredinnick ac64e91a0c Merged boulder-oracle-sprint branch (r3965:5512) back into trunk. All
expected tests pass for all databases.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5519 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-23 14:16:00 +00:00
Malcolm Tredinnick 553a20075e Fixed #4527 -- Changed the way errors are displayed in Form.as_p() to avoid
invalid XHTML constructs. Based on a patch from SmileyChris.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5518 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-23 06:19:26 +00:00
Malcolm Tredinnick dfea6bdfa5 Fixed #4630 -- Fixed some validation problems with SplitDateTimeField. Thanks
glin@seznam.cz and SmileyChris.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5515 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-23 03:32:59 +00:00
Malcolm Tredinnick 284c6ba44b Fixed #4657 -- Fixed an error in an edge case of the urlizetrunc filter.
Thanks, SmileyChris.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5513 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-23 03:10:32 +00:00
Malcolm Tredinnick a33fb695e3 Fixed #4475 -- Fixed a problem that was preventing streaming tests for the
serializers from ever being run. Based on a patch from ian.g.kelly@gmail.com.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5453 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-10 03:06:34 +00:00
Russell Keith-Magee 16269c4d0a Fixed #3523 -- Added list unpacking to for loops in templates. Thanks to SmileyChris and Honza Kral for their work.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5443 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-08 11:58:03 +00:00
Russell Keith-Magee ea07351799 Fixed #3466 -- Fixed problem with specifyin a 'fields' argument to a JSON serializer. Also added documenation for the 'fields' argument.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5409 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-01 13:39:08 +00:00
Jacob Kaplan-Moss bf2e62aa3c Fixed #3050: you can now use extra(select=...) with values(). Thanks, Honza Kral
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5385 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-31 02:22:41 +00:00
Russell Keith-Magee c84ff156c1 Fixed a serialization problem with objects that have a foreign key on an object whose primary key is a OneToOneField.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5371 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-28 05:41:32 +00:00
Malcolm Tredinnick 193a83ca50 Added a new form test that I forgot to commit in [5348]. Refs #3718.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5354 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-26 09:47:47 +00:00
Malcolm Tredinnick 92c35a0617 Fixed #2365, #3324 -- Renamed FloatField to DecimalField and changed the code
to return Decimal instances in Python for this field. Backwards incompatible
change.

Added a real FloatField (stores floats in the database) and support for
FloatField and DecimalField in newforms (analogous to IntegerField).

Included decimal.py module (as django.utils._decimal) from Python 2.4. This is
license compatible with Django and included for Python 2.3 compatibility only.

Large portions of this work are based on patches from Andy Durdin and Jorge
Gajon.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@5302 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-21 01:29:58 +00:00
Russell Keith-Magee edc0fcdf7c Moved markup tests into their contrib directory.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5297 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-20 04:08:14 +00:00
Russell Keith-Magee c9aa4c71ac Modified the django system test script to search for tests in the contrib apps.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5296 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-20 03:51:21 +00:00
Malcolm Tredinnick 534c0d8442 Fixed #4316 -- Added docstring and tests for django.newforms.utils.flatatt().
Thanks, Gary Wilson.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5291 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-19 18:49:35 +00:00
Malcolm Tredinnick 9ed4217a57 Fixed #4337 -- Added pop() method to QueryDict. Thanks, Gary Wilson.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5289 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-19 18:34:00 +00:00
Malcolm Tredinnick b996e214c0 Changed the fix from [5231] so that the backwards-incompatibility is made more
obvious and everything still has nice names.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5237 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-14 16:24:51 +00:00
Russell Keith-Magee 9350945963 Cleaned up the ordering of test data from [5232].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5233 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-14 14:21:00 +00:00
Russell Keith-Magee c38a93e4d9 Fixed #4288 -- Modified serializers to pay attention to the to_field attribute on ForeignKeys. Thanks to Sandro Dentella for the report and the helpful test case.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5232 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-14 14:14:49 +00:00
Malcolm Tredinnick f15036ae6d Renamed form-specific cleaning methods to be do_clean_*, rather than clean_*.
This avoids a name clash that would occur when you had a form field called
"data" (because clean_data is already a dictionary on the Form class).

Backwards incompatible change.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5231 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-14 14:02:36 +00:00
Russell Keith-Magee c89dc9cfa0 Fixed some incorrect reporting of error messages in assertRedirects, and added test cases to validate.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5228 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-14 11:07:14 +00:00
Adrian Holovaty 2c86d57284 Added unit tests and docs for the newforms case in which the form's data doesn't include a value for a nonrequired field
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5218 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-14 02:57:42 +00:00
Russell Keith-Magee 2345029d0d Fixed #4018 -- Added code to allow callables as initial data in newforms. Thanks for the patch, David Danier.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5209 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-12 15:50:32 +00:00
Russell Keith-Magee 6aa5091d58 Added docs for form_for_model and form_for_instance, and added a fields argument so it is easy to create forms from a subset of model fields.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5202 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-12 14:42:46 +00:00
Russell Keith-Magee ca5e12b4ee Removed unit tests added in [5196]; didn't notice the tests in modeltests/model_forms.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5201 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-12 12:22:50 +00:00
Russell Keith-Magee 1bb3ed7264 Added unit tests for form_for_model and form_for_instance.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5196 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-12 04:19:21 +00:00
Malcolm Tredinnick f9982c5c08 Fixed #4270 -- Don't permit deleting of items from an immutable QueryDict.
Thanks, Gary Wilson.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5187 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-11 08:22:06 +00:00
Russell Keith-Magee 70902908c7 Improved error reporting for assertions where there are no form errors, or a non-existent field has been provided. Also created a test client regression test, to hold the tests validating the failure cases of the TestCase assertions.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5181 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-10 13:46:15 +00:00
Russell Keith-Magee 5c68ab6e29 Added configurable arguments to assertRedirects and assertContains to allow for other response status codes. Thanks for the suggestion, Jiri Barton.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5179 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-10 11:27:59 +00:00
Russell Keith-Magee 469314e7bc Added redirection for email services during test conditions.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5173 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-08 11:19:34 +00:00
Malcolm Tredinnick 1c53661bd1 Moved generic relations into django.contrib.contenttypes, since it depends on
that to work. Backwards incompatible change.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5172 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-08 10:59:35 +00:00
Malcolm Tredinnick 0839a0046a Fixed #4041 -- Added a __contains__ method to cache backends. Thanks, Gary
Wilson and SmileyChris.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5171 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-08 04:13:46 +00:00
Malcolm Tredinnick faa31732ca Fixed #3753 -- Allow optional display of invalid variable name in
TEMPLATE_STRING_IF_INVALID. Thanks, Matt McClanahan.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5167 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-08 03:36:16 +00:00
Russell Keith-Magee f073797f4c Added assertFormError, assertTemplateUsed and assertTemplateNotUsed for use during unit testing.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5156 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-07 12:34:18 +00:00
Adrian Holovaty 1889db475d Fixed comma splice in error message introduced in [5133]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5154 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-06 04:12:08 +00:00
Russell Keith-Magee 36b164d838 Backwards incompatible change: Changed the way test.Client.login operates. Old implemenation was fragile, and tightly bound to forms. New implementation interfaces directly with the login system, is compatible with any authentication backend, and doesn't depend upon specific template inputs being available.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5152 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-05 15:16:15 +00:00
Russell Keith-Magee a0ef3ba2f7 Added a default test Client to TestCase, and added some assertions for some common testing patterns.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5150 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-05 03:03:33 +00:00
Malcolm Tredinnick d943f5ae92 Fixed #4130 -- Added more self-explanatory error message when a typo is made in
a queryset field argument.

We may need to fine-tune the error message based on experience down the line,
but this stands as an improvement on its own. Thanks, Ned Batchelder.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5133 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-01 03:21:54 +00:00
Malcolm Tredinnick 0b2f9e89cd Fixed #3946 -- Added Swiss localflavor. Thanks, charly.wilhelm@gmail.com.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5132 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-01 03:10:10 +00:00
Malcolm Tredinnick d9f1a0aaef Renamed one test to avoid a name-clash with an earlier test of the same name.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5125 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-04-28 16:41:44 +00:00
Malcolm Tredinnick d9cc22b3e3 Fixed #3268 -- Changed default model formfields to use a select widget when the
field has a choices attribute. Based on a patch from mrmachine.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5119 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-04-28 14:18:03 +00:00
Russell Keith-Magee 8a4a8023d6 Fixed #3698 -- Modified newforms labels to only add a colon if the label text doesn't end with punctuation. Thanks, SmileyChris.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5112 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-04-27 14:27:07 +00:00