Commit Graph

310 Commits

Author SHA1 Message Date
Malcolm Tredinnick cf3071242a Factor out some common pieces of django.conf.LazySettings.
This is in preparation for some reuse elsewhere in the core code.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9945 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-02 04:48:22 +00:00
Malcolm Tredinnick b337884fcf Fixed #10048 -- Handle non-existent timezone in dateformat functions.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9919 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-28 04:51:13 +00:00
Malcolm Tredinnick e20f09c2d0 Fixed #10006 -- Avoid inadvertently using third-party "json" module.
In r9707 we added a preference to use Python's standard json module (Python 2.6
and beyond). However, there is also a third-party module called json that was
being picked up by accident if it was installed. It isn't API compatible, so
bad things happened. This change avoids that problem.

Patch from markmuetz.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9910 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-27 05:14:11 +00:00
Brian Rosner e5cd43e588 Fixed #5903 -- DecimalField.get_default() now correctly returns a Decimal object when the model instance was not retrieved from the database. Thanks Justin Driscoll and pigletto.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9823 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-11 20:13:17 +00:00
Malcolm Tredinnick a9c2f033cd Upgraded included simplejson to 2.0.7.
Also changed importing logic to prefer a system-installed version of
simplejson (unless it's an earlier version that does not contian the C
speedups), then the json module from Python 2.6, then the version
shipped with Django.

Fixed #9266.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9707 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-06 05:13:02 +00:00
Karen Tracey dfa90aec1b Fixed #9579 -- Properly handle apps running with (and specifically, loading templates from) a current working directory path that contains non-ASCII characters. Thanks for the report to gonzalodelgado and for advice on how to fix it to Daniel Pope.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9411 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-13 19:03:42 +00:00
Malcolm Tredinnick 8fb1459b52 Added some better error reporting and path handling when creating template paths.
We now raise UnicodeDecodeError for non-UTF-8 bytestrings (thanks to Daniel
Pope for diagnosing this was being swallowed by ValueError) and allow UTF-8
bytestrings as template directories.

Refs #8965.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@9161 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-06 06:34:54 +00:00
Malcolm Tredinnick 399abd7fe8 Changed the reverse() call for creating URLs to convert a "." in the reg-exp
pattern to a "." in the final output. This hides what is probably a bug in the
pattern (the user almost certainly should have written "\."), but it will avoid
a large number of "bug" reports about reverse().


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8929 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-03 17:53:45 +00:00
Malcolm Tredinnick a9465a75de Fixed a case of incorrect parsing of quanitifers in reg-exp patterns.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8825 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 23:03:03 +00:00
Jacob Kaplan-Moss ea05e61b2b Fixed #8209: `ModelForm`s now validate unique constraints. Alex Gaynor did much of this work, and Brian Rosner helped as well.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8805 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01 19:08:08 +00:00
Malcolm Tredinnick 7838493b9e Fixed #8726 -- When doing reverse URL resolving, make sure we're consistently
dealing with unicode strings throughout by promoting up from UTF-8 as necessary.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8777 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-31 22:47:25 +00:00
Malcolm Tredinnick e1ea7014ad Fixed #8725 -- Handle empty URL patterns in reverse().
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8763 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-31 17:20:40 +00:00
Malcolm Tredinnick a63a83e5d8 A rewrite of the reverse URL parsing: the reverse() call and the "url" template tag.
This is fully backwards compatible, but it fixes a bunch of little bugs. Thanks
to SmileyChris and Ilya Semenov for some early patches in this area that were
incorporated into this change.

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


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8760 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-31 11:11:20 +00:00
Jacob Kaplan-Moss f2d7ee759a Fixed #8710: removed a few stray tabs. Thanks, gkelly.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8746 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-30 19:25:40 +00:00
Jacob Kaplan-Moss 503fda43fa Fixed #8654: added `ugettext_lazy` to `django.utils.translation.__all__`.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8680 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-28 20:20:40 +00:00
Jacob Kaplan-Moss 82179ccbbb Fixed #8637: fixed timeuntil and date values.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8668 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-28 16:31:50 +00:00
Malcolm Tredinnick 3b993b2995 Fixed #8584 -- Fixed a case where the wrong locale might be made active in the
locale detection loop. Thanks, Ramiro Morales.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8606 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-27 05:10:20 +00:00
Malcolm Tredinnick 05133baaaa Removed stray code from [8601].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8602 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-26 21:33:18 +00:00
Malcolm Tredinnick 1fc8f84f58 Fixed #8566 -- Allow safe-strings in the "attrs" parameter to form widgets.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8601 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-26 21:32:17 +00:00
Jacob Kaplan-Moss a0329d0ae3 Fixed #4389: be more robust in `get_language_bidi()`. Thanks, arien.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8596 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-26 20:08:02 +00:00
Malcolm Tredinnick c6a2bd9b96 Fixed #6353 (again) by making force_unicode() and smart_str() a bit more robust
in the face of funky Exception instances. This is slightly symptomatic of
problems in the calling code, but we don't want to raise a secondary exception
whilst trying to display the first one. Based on a patch from Karen Tracey.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8588 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-26 18:53:51 +00:00
Malcolm Tredinnick 3111d7f60b Fixed #7201 -- Fixed the timeuntil filter to work correctly with timezone-aware
times. Patch from Jeremy Carbaugh.

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


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8579 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-26 08:08:55 +00:00
Jacob Kaplan-Moss 6a5cc9e7f6 Fixed #7831: be case-insensitive when in `get_language_from_request`.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8561 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-25 22:53:44 +00:00
Malcolm Tredinnick 62b39322f3 Fixed #7496 -- It's now possible to pickle SortedDicts with pickle protocol 2
(used in caching). Thanks, John Huddleston.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8531 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-25 04:00:15 +00:00
Malcolm Tredinnick c127f0117d Fixed #8283 -- Fixed an edge case when adding things to the "where" tree and
combining different connector types.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8413 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-16 20:40:00 +00:00
Gary Wilson Jr 2b82a3bcfc Fixed #7331 -- Made `QueryDict.iteritems` behave like `QueryDict.items`, thanks jurev.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8399 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-16 02:17:55 +00:00
Malcolm Tredinnick 3b45a40c54 Fixed #8219 -- More robust date to string conversion in syndication feeds.
(Sometimes) Affects people running in locales that use non-ASCII date strings.
Patch from alperkanat.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8397 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-15 22:13:50 +00:00
Gary Wilson Jr 90c67e0f55 Fixed typo in comment.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8382 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-15 16:38:41 +00:00
Jacob Kaplan-Moss d05c725308 Fixed #8253: fixed xmlns regression for Atom feeds, and in the process added a hook for adding attributes specifically on the root <rss> element (for RSS feeds only, of course). Patch by Justin Bronn.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8331 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-12 22:12:14 +00:00
Jacob Kaplan-Moss 942e5246ac Added a number of callbacks to SyndicationFeed for adding custom attributes and elements to feeds. Refs #6547.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8311 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-11 22:22:26 +00:00
Gary Wilson Jr ef48a3e69c Fixed #7830 -- Removed all of the remaining, deprecated, non-oldforms features:
* Support for representing files as strings was removed. Use `django.core.files.base.ContentFile` instead.
 * Support for representing uploaded files as dictionaries was removed. Use `django.core.files.uploadedfile.SimpleUploadedFile` instead.
 * The `filename`, `file_name`, `file_size`, and `chuck` properties of `UploadedFile` were removed. Use the `name`, `name`, `size`, and `chunks` properties instead, respectively.
 * The `get_FIELD_filename`, `get_FIELD_url`, `get_FIELD_size`, and `save_FIELD_file` methods for Models with `FileField` fields were removed. Instead, use the `path`, `url`, and `size` attributes and `save` method on the field itself, respectively.
 * The `get_FIELD_width` and `get_FIELD_height` methods for Models with `ImageField` fields were removed. Use the `width` and `height` attributes on the field itself instead.
 * The dispatcher `connect`, `disconnect`, `send`, and `sendExact` functions were removed. Use the signal object's own `connect`, `disconnect`, `send`, and `send` methods instead, respectively.
 * The `form_for_model` and `form_for_instance` functions were removed. Use a `ModelForm` subclass instead.
 * Support for importing `django.newforms` was removed. Use `django.forms` instead.
 * Support for importing `django.utils.images` was removed. Use `django.core.files.images` instead.
 * Support for the `follow` argument in the `create_object` and `update_object` generic views was removed. Use the `django.forms` package and the new `form_class` argument instead.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8291 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-10 21:10:47 +00:00
Jacob Kaplan-Moss 7899568e01 File storage refactoring, adding far more flexibility to Django's file handling. The new files.txt document has details of the new features.
This is a backwards-incompatible change; consult BackwardsIncompatibleChanges for details.

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

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


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8244 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-08 20:59:02 +00:00
Malcolm Tredinnick 34028f3ef3 Fixed #8142 -- Removed an unnecessary parameter in a superclass init call.
Patch from Karen Tracey.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8237 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-08 18:33:02 +00:00
Malcolm Tredinnick be4390f834 Made auto-reloading for the dev server a little more friendly in the Jython
case. Patch from Leo Soto. Fixed #8147.

In passing, also corrected a typo when reloading .pyo files. Fixed #8157.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8235 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-08 17:54:35 +00:00
Jacob Kaplan-Moss 34008aaeb0 Fixed #7016: use correct time zones for Atom feeds. Thanks, Chris Cahoon.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8216 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-05 17:38:49 +00:00
Gary Wilson Jr c85c8f8891 Fixed #7919 -- md5 and sha modules are deprecated since Python 2.5, use hashlib module when available. Patch from Karen Tracey.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8193 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-02 05:56:57 +00:00
Gary Wilson Jr 351a3ca154 Removed several deprecated features for 1.0 (refs #7830):
* "simple" cache backend
 * `ObjectPaginator`
 * `edit_inline_type` argument for `ForeignKey` fields
 * `QOperator`, `QNot`, `QAnd` and `QOr`
 * `maxlength` argument 


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8191 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-02 04:56:11 +00:00
Luke Plant fcd837cd0f Fixed #7723 - implemented a secure password reset form that uses a token and prompts user for new password.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8162 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-31 20:47:53 +00:00
Malcolm Tredinnick 55ba38f9d2 Put back [8120] along with a small tweak. Fixed #6217.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8127 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-28 00:45:04 +00:00
Malcolm Tredinnick eca5aacec8 Back out [8120] for a bit. Refs #6217. It's having unintended side-effects (a.k.a breaks the tree)
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8126 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-28 00:08:17 +00:00
Malcolm Tredinnick d57ce3d6a9 Fixed #7131 -- Updated included simplejson code to match the simplejson-1.9.2
release. This should be fully backwards-compatible for people using the public
interfaces.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8124 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-27 23:38:28 +00:00
Malcolm Tredinnick 6a287ed946 Fixed #6217 -- Reduced the memory used by each ugettext_lazy() call.
Thanks to Jakub Wilk for analysis and the initial patch.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8120 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-27 22:51:49 +00:00
Adrian Holovaty 29f0e8182f Fixed #7847 -- Removed a whole bunch of unused imports from throughout the codebase. Thanks, julien
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8046 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-22 03:24:09 +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
Malcolm Tredinnick 189c704ae6 Revert [7991] - [7993]. I was committing from the wrong branch. Sorry 'bout
that, folks. :-(


git-svn-id: http://code.djangoproject.com/svn/django/trunk@7995 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-19 19:37:55 +00:00
Malcolm Tredinnick ff68e85b8e Starting to do the reverse() threading stuff.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7993 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-19 19:32:18 +00:00
Malcolm Tredinnick c09351aec6 Fixed #6965 -- Sped up the urlize and urlizetrunc filters. A nice patch from Andrew Badr.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7985 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-19 18:05:22 +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
Adrian Holovaty f6fafc02c8 Improved LocalTimezone._isdst() to handle dates before approximately 1901-12-01 (the specific cutoff date is platform-specific). Refs #1443
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7945 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-18 03:45: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