Commit Graph

8679 Commits

Author SHA1 Message Date
Aymeric Augustin e0449316eb Fixed #18130 -- Made the isolation level configurable on PostgreSQL.
Thanks limscoder for the report and niwi for the draft patch.
2013-03-02 15:05:49 +01:00
Aymeric Augustin d63e55039d Reordered methods in database wrappers.
* Grouped related methods together -- with banner comments :/
* Described which methods are intended to be implemented in backends.
* Added docstrings.
* Used the same order in all wrappers.
2013-03-02 13:33:17 +01:00
Claude Paroz c5a25c2771 Add introspection support for BinaryField 2013-03-02 10:29:03 +01:00
Claude Paroz d680a3f447 Added support for serializing BinaryField 2013-03-02 10:29:02 +01:00
Claude Paroz 8ee1eddb7e Add a BinaryField model field
Thanks Michael Jung, Charl Botha and Florian Apolloner for review
and help on the patch.
2013-03-02 10:29:02 +01:00
Simon Charette 952ba5237e Added a context manager to capture queries while testing.
Also made some import cleanups while I was there.

Refs #10399.
2013-03-02 02:41:14 -05:00
Aymeric Augustin 203c17c21e Added import forgotten in 2ee21d9.
Thanks ratsonale for spotting this mistake.
2013-03-01 23:46:53 +01:00
Claude Paroz 0657646cb8 Removed unused options copy in flush
This was used at the time the 'database' option did not default to
DEFAULT_DB_ALIAS in make_option.
2013-03-01 22:52:08 +01:00
Claude Paroz 3318595c0b Fixed #18898 -- Added tests with a fix for ModelMultipleChoiceField 2013-03-01 09:35:18 +01:00
Claude Paroz 892bc91cb0 Fixed #16612 -- Improved has_changed detection for localized field values
Thanks Simon Charette for the review.
2013-03-01 09:35:04 +01:00
Aymeric Augustin 0c82b1dfc4 Fixed #19929 -- Improved error when MySQL doesn't have TZ definitions.
Thanks tomas_00 for the report.
2013-02-28 17:35:13 +01:00
Aymeric Augustin cf30469164 Fixed tests broken in 2ee21d9. 2013-02-28 17:08:16 +01:00
Aymeric Augustin 2ee21d9f0d Implemented persistent database connections.
Thanks Anssi Kääriäinen and Karen Tracey for their inputs.
2013-02-28 15:28:13 +01:00
Aymeric Augustin aa089b106b Fixed #5241 -- Kept active transalation in LocaleMiddleware.process_response. 2013-02-28 14:21:48 +01:00
Anssi Kääriäinen 06de130dae Fixed #12823 -- Was already fixed in master, tests added
Also added a little improvement to sql/query.py to get rid of
non-necessary IS NOT NULL check.
2013-02-28 15:05:48 +02:00
Aymeric Augustin 1b100d7bee Fixed two bugs in 59a35208.
* StandardError doesn't exist any more under Python 3.
* Python 2.6 still allows `raise "foo"`.
2013-02-27 19:24:23 +01:00
Aymeric Augustin 59a3520875 Refactored database exceptions wrapping.
Squashed commit of the following:

commit 2181d833ed1a2e422494738dcef311164c4e097e
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Wed Feb 27 14:28:39 2013 +0100

    Fixed #15901 -- Wrapped all PEP-249 exceptions.

commit 5476a5d93c19aa2f928c497d39ce6e33f52694e2
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Feb 26 17:26:52 2013 +0100

    Added PEP 3134 exception chaining.

    Thanks Jacob Kaplan-Moss for the suggestion.

commit 9365fad0a650328002fb424457d675a273c95802
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Feb 26 17:13:49 2013 +0100

    Improved API for wrapping database errors.

    Thanks Alex Gaynor for the proposal.

commit 1b463b765f2826f73a8d9266795cd5da4f8d5e9e
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Feb 26 15:00:39 2013 +0100

    Removed redundant exception wrapping.

    This is now taken care of by the cursor wrapper.

commit 524bc7345a724bf526bdd2dd1bcf5ede67d6bb5c
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Feb 26 14:55:10 2013 +0100

    Wrapped database exceptions in the base backend.

    This covers the most common PEP-249 APIs:
    - Connection APIs: close(), commit(), rollback(), cursor()
    - Cursor APIs: callproc(), close(), execute(), executemany(),
      fetchone(), fetchmany(), fetchall(), nextset().

    Fixed #19920.

commit a66746bb5f0839f35543222787fce3b6a0d0a3ea
Author: Aymeric Augustin <aymeric.augustin@m4x.org>
Date:   Tue Feb 26 14:53:34 2013 +0100

    Added a wrap_database_exception context manager and decorator.

    It re-throws backend-specific exceptions using Django's common wrappers.
2013-02-27 17:26:54 +01:00
Anssi Kääriäinen 50328f0a61 Fixed #19861 -- Transaction ._dirty flag improvement
There were a couple of errors in ._dirty flag handling:
  * It started as None, but was never reset to None.
  * The _dirty flag was sometimes used to indicate if the connection
    was inside transaction management, but this was not done
    consistently. This also meant the flag had three separate values.
  * The None value had a special meaning, causing for example inability
    to commit() on new connection unless enter/leave tx management was
    done.
  * The _dirty was tracking "connection in transaction" state, but only
    in managed transactions.
  * Some tests never reset the transaction state of the used connection.
  * And some additional less important changes.

This commit has some potential for regressions, but as the above list
shows, the current situation isn't perfect either.
2013-02-27 17:54:27 +02:00
Łukasz Langa 40b9f4fb8b [py3] Always fed hashlib with bytes. 2013-02-27 10:02:07 +01:00
Ramiro Morales 8459eac031 Move management helper function to new utils module.
This allows us to iremove an inter-command import.
2013-02-26 22:07:22 -03:00
Ramiro Morales dfa9324966 Don't use os.system() in compilemessages.
Fixes #19584.

This implies stop storing file path command line arguments in envvars as
a security measure to start relying on with Popen's shell=False instead,
and addition of an 'utils' module.

Thanks kmichel_wgs for the report.
2013-02-26 21:31:53 -03:00
Claude Paroz 87cc3da814 Merged contrib translations from 1.5 branch 2013-02-26 21:51:06 +01:00
Claude Paroz 6ca475d540 Merged core translations from 1.5 branch 2013-02-26 21:51:06 +01:00
Łukasz Langa 6a057e1595 Fixed #18191 -- Don't consider Accept-Language redundantly in cache key.
Thanks to choongmin for the original patch.
2013-02-25 16:10:57 -07:00
Aymeric Augustin e76147a83a Fixed #19634 -- Added proper __hash__ methods.
Classes overriding __eq__ need a __hash__ such that equal objects have
the same hash.

Thanks akaariai for the report and regebro for the patch.
2013-02-25 23:05:20 +01:00
Aymeric Augustin f1255a3c09 Fixed #18144 -- Restored compatibility with SHA1 hashes with empty salt.
Thanks dahool for the report and initial version of the patch.
2013-02-25 20:21:58 +01:00
Carl Meyer 906dc8522a Fixed #19854 -- Turn Django's own Selenium tests off by default. 2013-02-25 10:14:42 -07:00
Carl Meyer 87e8dfaa47 Switching to autoescape is not a change in syntax. 2013-02-25 00:43:03 -07:00
Carl Meyer 3ded2aef71 Remove leading underscore from a function that's all growed up now.
This function is now the de facto standard function for rendering values in a
template, and is imported by two other built-in template modules. It shouldn't
have a leading underscore.
2013-02-25 00:33:29 -07:00
Claude Paroz 5eebb49c69 Fixed #19908 -- Added missing import in forms.py
Thanks loic84 for the report.
2013-02-24 22:59:15 +01:00
Julien Phalip a8449d4362 Merge pull request #824 from ambv/languagecode 2013-02-24 12:56:14 -08:00
Julien Phalip 438ce4ec55 Fixed some docstrings that were raising Sphinx warnings when running the admindocs tests. 2013-02-24 12:03:24 -08:00
Florian Apolloner b88bf9f125 Fixed python 3 support. Refs #17320 2013-02-24 18:35:08 +01:00
Aymeric Augustin e3e0f49ece Merge pull request #834 from vdboor/issue_19906_list_classes
Added column-<field_name> classes to the admin list
2013-02-24 08:58:57 -08:00
Diederik van der Boor b7ba4fc408 Add column-<field_name> classes to the admin list
This simplifies CSS styling to set column widths.
2013-02-24 17:50:23 +01:00
Florian Apolloner 5e52dc2ade Merge pull request #828 from zerok/tickets/17320
Fixed #17320 -- Added whitespace validation to Site.domain field
2013-02-24 08:39:27 -08:00
Simon Charette 6b03179e12 Fixed #19688 -- Allow model subclassing with a custom metaclass using six.with_metaclass 2013-02-24 17:32:34 +01:00
Christopher Medrela 636c45fc58 Fixed #19890 -- ifchanged templatetag rendered its content twice
The content of ifchanged template tag was rendered twice: first time, to
compare it with the previous value and the second time, to return the
rendered output.
2013-02-24 16:49:28 +01:00
Horst Gutmann c729461479 Fixed #17320 -- Added whitespace validation to the Site.domain field 2013-02-24 16:40:51 +01:00
Diederik van der Boor 8503120c10 Fixed #15849 -- Made IfChanged node thread safe.
Previously, the ifchanged node stored state on `self._last_seen`,
thereby giving undesired results when the node is reused by another
thread at the same time (e.g. globally caching a Template object).

Thanks to akaihola for the report and Diederik van der Boor and
Bas Peschier for the patch.
2013-02-24 16:06:55 +01:00
Zbigniew Siciarz 0a8402eb05 Test case and docs for custom context data in feeds
Thanks Paul Winkler for the initial patch. (Ref #18112).
2013-02-24 08:33:20 -06:00
Florian Apolloner 4506ae0497 Merge pull request #717 from slurms/ticket_19746
Fixed #19746 -- Allow deserialization of pk-less data
2013-02-24 06:31:14 -08:00
Aymeric Augustin bc787f6a32 Loaded cycle and firstof from future in built-in templates. Refs #17906.
This was missing from f49e9a517f.
2013-02-24 15:16:45 +01:00
Łukasz Langa 8c8f94fe9d Fixes #19763 - LocaleMiddleware should check for supported languages in settings.LANGUAGE_CODE 2013-02-24 14:43:45 +01:00
Tomek Paczkowski 99edbe0e27 Fixed #19253 -- Extracted template cache key building logic
Introduced a public function
django.core.cache.utils.make_template_fragment_key
Thanks @chrismedrela for fruitful cooperation.
2013-02-24 14:32:45 +01:00
Joeri Bekker b9cc61021a Fixed #9084 - Best approach for an OS to atomically rename the session file. 2013-02-24 14:21:40 +01:00
Aymeric Augustin 7106a1e594 Merge pull request #819 from erikr/master
Fixed #16302 -- Ensured contrib.comments is IPv6 capable.
2013-02-24 05:02:00 -08:00
Erik Romijn ade992c61e Fixed #16302 -- Ensure contrib.comments is IPv6 capable
Changed the ip_address field for Comment to GenericIPAddressField. Added
instructions to the release notes on how to update the schema of existing
databases.
2013-02-24 13:58:38 +01:00
Bas Peschier 5a9b2bce24 Fixed #19810 -- MemcachedCache now uses pickle.HIGHEST_PROTOCOL 2013-02-24 13:56:15 +01:00
Honza Král d7e835f76d Merge pull request #820 from viciu/11295
Fixed #11295: If ModelAdmin.queryset returns a filtered QS don't require a 2nd count call
2013-02-24 04:35:27 -08:00