diff options
| author | Andrew Godwin <andrew@aeracode.org> | 2013-08-23 12:36:53 +0100 |
|---|---|---|
| committer | Andrew Godwin <andrew@aeracode.org> | 2013-08-23 12:36:53 +0100 |
| commit | 5569b0b92f0504aadf0376f9cf0cb09106cd3e92 (patch) | |
| tree | e82fda531a8ef41e8a32054f4fe55eb288457994 /docs/ref | |
| parent | 9cc6cfc4057e07b73a1d72a1177d568362b0c517 (diff) | |
| parent | 57c82f909b212708a17edd11014be718bd02be3b (diff) | |
Merge remote-tracking branch 'core/master' into schema-alteration
Conflicts:
django/db/backends/oracle/base.py
django/db/backends/postgresql_psycopg2/base.py
django/db/models/signals.py
tests/queries/tests.py
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/class-based-views/base.txt | 4 | ||||
| -rw-r--r-- | docs/ref/models/instances.txt | 30 | ||||
| -rw-r--r-- | docs/ref/settings.txt | 39 |
3 files changed, 58 insertions, 15 deletions
diff --git a/docs/ref/class-based-views/base.txt b/docs/ref/class-based-views/base.txt index 0db1e15ea9..f0543e6095 100644 --- a/docs/ref/class-based-views/base.txt +++ b/docs/ref/class-based-views/base.txt @@ -79,10 +79,6 @@ View you can override the ``head()`` method. See :ref:`supporting-other-http-methods` for an example. - The default implementation also sets ``request``, ``args`` and - ``kwargs`` as instance variables, so any method on the view can know - the full details of the request that was made to invoke the view. - .. method:: http_method_not_allowed(request, *args, **kwargs) If the view was called with a HTTP method it doesn't support, this diff --git a/docs/ref/models/instances.txt b/docs/ref/models/instances.txt index 015393a408..da657a9a01 100644 --- a/docs/ref/models/instances.txt +++ b/docs/ref/models/instances.txt @@ -104,14 +104,9 @@ aren't present on your form from being validated since any errors raised could not be corrected by the user. Note that ``full_clean()`` will *not* be called automatically when you call -your model's :meth:`~Model.save()` method, nor as a result of -:class:`~django.forms.ModelForm` validation. In the case of -:class:`~django.forms.ModelForm` validation, :meth:`Model.clean_fields()`, -:meth:`Model.clean()`, and :meth:`Model.validate_unique()` are all called -individually. - -You'll need to call ``full_clean`` manually when you want to run one-step model -validation for your own manually created models. For example:: +your model's :meth:`~Model.save()` method. You'll need to call it manually +when you want to run one-step model validation for your own manually created +models. For example:: from django.core.exceptions import ValidationError try: @@ -526,6 +521,25 @@ For example:: In previous versions only instances of the exact same class and same primary key value were considered equal. +``__hash__`` +------------ + +.. method:: Model.__hash__() + +The ``__hash__`` method is based on the instance's primary key value. It +is effectively hash(obj.pk). If the instance doesn't have a primary key +value then a ``TypeError`` will be raised (otherwise the ``__hash__`` +method would return different values before and after the instance is +saved, but changing the ``__hash__`` value of an instance `is forbidden +in Python`_). + +.. versionchanged:: 1.7 + + In previous versions instance's without primary key value were + hashable. + +.. _is forbidden in Python: http://docs.python.org/reference/datamodel.html#object.__hash__ + ``get_absolute_url`` -------------------- diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index 424f7d5795..2f531803bc 100644 --- a/docs/ref/settings.txt +++ b/docs/ref/settings.txt @@ -1290,11 +1290,22 @@ LANGUAGE_CODE Default: ``'en-us'`` -A string representing the language code for this installation. This should be -in standard :term:`language format<language code>`. For example, U.S. English +A string representing the language code for this installation. This should be in +standard :term:`language ID format <language code>`. For example, U.S. English is ``"en-us"``. See also the `list of language identifiers`_ and :doc:`/topics/i18n/index`. +:setting:`USE_I18N` must be active for this setting to have any effect. + +It serves two purposes: + +* If the locale middleware isn't in use, it decides which translation is served + to all users. +* If the locale middleware is active, it provides the fallback translation when + no translation exist for a given literal to the user's preferred language. + +See :ref:`how-django-discovers-language-preference` for more details. + .. _list of language identifiers: http://www.i18nguy.com/unicode/language-identifiers.html .. setting:: LANGUAGE_COOKIE_NAME @@ -2392,7 +2403,7 @@ SESSION_ENGINE Default: ``django.contrib.sessions.backends.db`` -Controls where Django stores session data. Valid values are: +Controls where Django stores session data. Included engines are: * ``'django.contrib.sessions.backends.db'`` * ``'django.contrib.sessions.backends.file'`` @@ -2435,6 +2446,28 @@ Whether to save the session data on every request. If this is ``False`` (default), then the session data will only be saved if it has been modified -- that is, if any of its dictionary values have been assigned or deleted. +.. setting:: SESSION_SERIALIZER + +SESSION_SERIALIZER +------------------ + +Default: ``'django.contrib.sessions.serializers.JSONSerializer'`` + +.. versionchanged:: 1.6 + + The default switched from + :class:`~django.contrib.sessions.serializers.PickleSerializer` to + :class:`~django.contrib.sessions.serializers.JSONSerializer` in Django 1.6. + +Full import path of a serializer class to use for serializing session data. +Included serializers are: + +* ``'django.contrib.sessions.serializers.PickleSerializer'`` +* ``'django.contrib.sessions.serializers.JSONSerializer'`` + +See :ref:`session_serialization` for details, including a warning regarding +possible remote code execution when using +:class:`~django.contrib.sessions.serializers.PickleSerializer`. Sites ===== |
