Commit Graph

861 Commits

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


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

Great work from Leo Soto.


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


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8128 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-28 01:32:46 +00:00
Gary Wilson Jr 9a5301ccbc Made the Paginator class a bit more backwards compatible with the lecacy `ObjectPaginator` class by using the `ObjectPaginator`'s `_get_count` method. Instead of explicitly checking for an instance of `QuerySet`, this now allows any object with a `count()` or `__len__()` method defined to be passed to Paginator. For one, this is useful when you have custom `QuerySet`-like classes that implement a `count()` method but don't inherit from `QuerySet` explicitly.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8121 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-27 23:01:55 +00:00
Gary Wilson Jr 66d5018dd1 Corrected wording in comment.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8114 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-27 19:05:54 +00:00
Malcolm Tredinnick 82a85fdbae Fixed #6427 -- Added some more features to the Austrian localflavor.
Thanks, Horst Gutmann.


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


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


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


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


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8098 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-27 01:18:23 +00:00
Malcolm Tredinnick aee55ce524 Changed one of the model_formsets tests to be immune to the differences in the
natural collation ordering used by different databases (normally, this test
would fail on PostgreSQL, but not because the code was incorrect). This is
purely a test tweak.


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


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


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8095 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-26 22:09:43 +00:00
Russell Keith-Magee eca3c7d3d6 Added an ordering definition to make test output reliable across database backends.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8091 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-26 14:49:39 +00:00
Malcolm Tredinnick 108b604b51 Fixed #7345 -- When normalising the URLField form field, attach a trailing
slash when only a host (no path) is given. Thanks, jpwatts.


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


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


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

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


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8061 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-23 06:12:15 +00:00
Brian Rosner 3912403550 Added the ability to customize the prefix value on an inline formset. Fixes #7899. AThanks for the tip Peter of the Norse.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8060 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-23 04:46:31 +00:00
Malcolm Tredinnick 681e7bbd25 Removed some potentially misleading code (it isn't executed) after the changes
in [8055]. Thanks, Karen. Refs #7745.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8059 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-23 04:41:53 +00:00
Brian Rosner 9d8f41baac Made the semi-private _max_form_count live on the public API of formsets by renaming it to max_num. This also removes the ManagementForm use of MAX_COUNT since that usage should just be referenced to the formset's max_num property. Refs #7899. Thanks Peter of the Norse for straightening me out.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8058 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-23 04:28:52 +00:00
Russell Keith-Magee 437945146d Fixed #7906 -- Modified admin_scripts regression test to use the same python executable that is running the test suite, rather than using 'python' on the path. Thanks to Chris Hasenpflug for the report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8056 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-23 03:00:50 +00:00
Malcolm Tredinnick c5a76a3669 Fixed a bunch of Python 2.3 test failures.
All remaining buildbot failures on 2.3 are not due to the test suite, as far as
I can work out.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8055 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-22 19:48:36 +00:00
Malcolm Tredinnick d1ea8b2842 Changed the test from [8052] so that it is insensitive to whether a database
sorts NULLs first or last in a sequence or results.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8054 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-22 18:56:50 +00:00
Malcolm Tredinnick 8745beccb1 Fixed #7813 -- Allow pickling of Query classes that use select_related().
Based on a patch from Justin Bronn.

The test in this patch most likely breaks on Oracle. That's another issue.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8053 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-22 08:23:20 +00:00
Malcolm Tredinnick 83e97ecf88 Fixed #7791 -- Fixed a really silly error I introduced in [7926]. :-(
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8052 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-22 07:37:09 +00:00
Malcolm Tredinnick 0e9587fd6b Fixed the tests from [8033] to work for the PostgreSQL backends (the primary
key value isn't guaranteed to be the same across all backends). Still some
breakage on MySQL because of the way it treats booleans, but that's another
issue.

Refs #6755.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8051 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-22 05:15:40 +00:00
Adrian Holovaty 8bc442e771 Fixed #7304 -- Gave AnonymousUser a has_perms() method, which it was lacking
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8044 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-22 03:05:40 +00:00
Jacob Kaplan-Moss 863f4eb1d7 Fixed #6755: model inheritance now works in the admin. Thanks, sloonz and Michael Placentra.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8033 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-22 01:10:06 +00:00
Luke Plant 384a721e1c Fixed #7825 - modeltests/delete tests failing after NFA merge, and improved documentation of these tests.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8030 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-21 17:28:21 +00:00
Jacob Kaplan-Moss 970611827b FIxed #7666: use a bare queryset when accessing single related objects so that the related objects never become inaccessible.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8017 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-21 15:41:21 +00:00
Russell Keith-Magee 4016d5264a Fixed #7727 -- Improved the checks for import failure when using PIL. Under PyPy, you can import the PIL module, but when you try to use it, the underlying _imaging module will not be available. Thanks to Maciej Fijalkowski (fijal) for the report and suggested fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8016 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-21 11:52:11 +00:00
Malcolm Tredinnick bfcecbffd3 Changed/fixed the way Django handles SCRIPT_NAME and PATH_INFO (or
equivalents). Basically, URL resolving will only use the PATH_INFO and the
SCRIPT_NAME will be prepended by reverse() automatically. Allows for more
portable development and installation. Also exposes SCRIPT_NAME in the
HttpRequest instance.

There are a number of cases where things don't work completely transparently,
so mod_python and fastcgi users should read the relevant docs.

Fixed #285, #1516, #3414.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8015 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-21 07:57:10 +00:00
Gary Wilson Jr 80ac41e2f7 Corrected typo.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8013 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-21 03:50:40 +00:00
Russell Keith-Magee d911a64ce8 Fixed #6450 -- Improved the checking of errors when creating the directories for saved files. Thanks to henry@precheur.org for the report and patch, and vung for the excellent test case.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8007 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-20 12:44:41 +00:00
Russell Keith-Magee 6db9fd0116 Made the test case for doctest comparison of XML fragments a little more rigorous. Refs #7441.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8005 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-20 08:47:10 +00:00
Russell Keith-Magee b58de15139 Fixed #7339 -- Added manual calls to the garbage collector. This is required for PyPy and Jython; these implementations don't use reference counting, so you can't rely on __del__ being run immediately after del is called. Thanks to Maciej Fijalkowski (fijal) and Leo Soto.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8004 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-20 06:32:54 +00:00
Russell Keith-Magee 2f49d18071 Fixed #7441 -- Removed some of the shortcuts in the doctest output comparators, and added a wrapper to allow comparison of xml fragments. Thanks to Leo Soto for the report and fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8003 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-20 05:46:41 +00:00
Malcolm Tredinnick 5141b67a19 Reverted [7986].
It turns out that we need to treat filename creation/display (in
particular, the upload_to path) differently depending upon whether the value is
out of the database or provided by other code and there's no reliable way to
determine that at the moment (although some later proposed changes might alter
that). So calling get_FIELD_filename on an unsaved model with a changed file
attribute will not necessarily return the same result as after the save().

Refs #5619. Fixed #7843.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7998 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-19 22:26:32 +00:00