mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Removed versionadded/changed annotations dating back to 1.4.
This commit is contained in:
parent
ef017a5f00
commit
7ee7599ab3
49 changed files with 59 additions and 409 deletions
|
@ -522,12 +522,10 @@ The permission_required decorator
|
|||
As in the :func:`~django.contrib.auth.decorators.login_required` decorator,
|
||||
``login_url`` defaults to :setting:`settings.LOGIN_URL <LOGIN_URL>`.
|
||||
|
||||
.. versionchanged:: 1.4
|
||||
|
||||
Added ``raise_exception`` parameter. If given, the decorator will raise
|
||||
:exc:`~django.core.exceptions.PermissionDenied`, prompting
|
||||
:ref:`the 403 (HTTP Forbidden) view<http_forbidden_view>` instead of
|
||||
redirecting to the login page.
|
||||
If the ``raise_exception`` parameter is given, the decorator will raise
|
||||
:exc:`~django.core.exceptions.PermissionDenied`, prompting :ref:`the 403
|
||||
(HTTP Forbidden) view<http_forbidden_view>` instead of redirecting to the
|
||||
login page.
|
||||
|
||||
Applying permissions to generic views
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
@ -552,8 +550,6 @@ password management. These make use of the :ref:`stock auth forms
|
|||
Django provides no default template for the authentication views - however the
|
||||
template context is documented for each view below.
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
The built-in views all return
|
||||
a :class:`~django.template.response.TemplateResponse` instance, which allows
|
||||
you to easily customize the response data before rendering. For more details,
|
||||
|
@ -747,11 +743,10 @@ patterns.
|
|||
that can be used to reset the password, and sending that link to the
|
||||
user's registered email address.
|
||||
|
||||
.. versionchanged:: 1.4
|
||||
Users flagged with an unusable password (see
|
||||
:meth:`~django.contrib.auth.models.User.set_unusable_password()`
|
||||
will not be able to request a password reset to prevent misuse
|
||||
when using an external authentication source like LDAP.
|
||||
Users flagged with an unusable password (see
|
||||
:meth:`~django.contrib.auth.models.User.set_unusable_password()` aren't
|
||||
allowed to request a password reset to prevent misuse when using an
|
||||
external authentication source like LDAP.
|
||||
|
||||
**URL name:** ``password_reset``
|
||||
|
||||
|
@ -769,8 +764,6 @@ patterns.
|
|||
the subject of the email with the reset password link. Defaults
|
||||
to :file:`registration/password_reset_subject.txt` if not supplied.
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
* ``password_reset_form``: Form that will be used to get the email of
|
||||
the user to reset the password for. Defaults to
|
||||
:class:`~django.contrib.auth.forms.PasswordResetForm`.
|
||||
|
|
|
@ -13,10 +13,8 @@ work with hashed passwords.
|
|||
How Django stores passwords
|
||||
===========================
|
||||
|
||||
.. versionadded:: 1.4
|
||||
Django 1.4 introduces a new flexible password storage system and uses
|
||||
PBKDF2 by default. Previous versions of Django used SHA1, and other
|
||||
algorithms couldn't be chosen.
|
||||
Django provides a flexible password storage system and uses PBKDF2 by default.
|
||||
Older versions of Django used SHA1, and other algorithms couldn't be chosen.
|
||||
|
||||
The :attr:`~django.contrib.auth.models.User.password` attribute of a
|
||||
:class:`~django.contrib.auth.models.User` object is a string in this format::
|
||||
|
@ -173,15 +171,12 @@ Manually managing a user's password
|
|||
|
||||
.. module:: django.contrib.auth.hashers
|
||||
|
||||
.. versionadded:: 1.4
|
||||
The :mod:`django.contrib.auth.hashers` module provides a set of functions
|
||||
to create and validate hashed password. You can use them independently
|
||||
from the ``User`` model.
|
||||
|
||||
.. function:: check_password(password, encoded)
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
If you'd like to manually authenticate a user by comparing a plain-text
|
||||
password to the hashed password in the database, use the convenience
|
||||
function :func:`django.contrib.auth.hashers.check_password`. It takes two
|
||||
|
@ -191,8 +186,6 @@ Manually managing a user's password
|
|||
|
||||
.. function:: make_password(password[, salt, hashers])
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
Creates a hashed password in the format used by this application. It takes
|
||||
one mandatory argument: the password in plain-text. Optionally, you can
|
||||
provide a salt and a hashing algorithm to use, if you don't want to use the
|
||||
|
@ -206,7 +199,5 @@ Manually managing a user's password
|
|||
|
||||
.. function:: is_password_usable(encoded_password)
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
Checks if the given string is a hashed password that has a chance
|
||||
of being verified against :func:`django.contrib.auth.hashers.check_password`.
|
||||
|
|
|
@ -482,8 +482,6 @@ include the name of the active :term:`language<language code>` -- see also
|
|||
:ref:`how-django-discovers-language-preference`). This allows you to easily
|
||||
cache multilingual sites without having to create the cache key yourself.
|
||||
|
||||
.. versionchanged:: 1.4
|
||||
|
||||
Cache keys also include the active :term:`language <language code>` when
|
||||
:setting:`USE_L10N` is set to ``True`` and the :ref:`current time zone
|
||||
<default-current-time-zone>` when :setting:`USE_TZ` is set to ``True``.
|
||||
|
|
|
@ -412,14 +412,13 @@ translates (roughly) into the following SQL::
|
|||
|
||||
.. _`Keyword Arguments`: http://docs.python.org/tutorial/controlflow.html#keyword-arguments
|
||||
|
||||
.. versionchanged:: 1.4
|
||||
The field specified in a lookup has to be the name of a model field.
|
||||
There's one exception though, in case of a
|
||||
:class:`~django.db.models.ForeignKey` you can specify the field
|
||||
name suffixed with ``_id``. In this case, the value parameter is expected
|
||||
to contain the raw value of the foreign model's primary key. For example:
|
||||
The field specified in a lookup has to be the name of a model field. There's
|
||||
one exception though, in case of a :class:`~django.db.models.ForeignKey` you
|
||||
can specify the field name suffixed with ``_id``. In this case, the value
|
||||
parameter is expected to contain the raw value of the foreign model's primary
|
||||
key. For example:
|
||||
|
||||
>>> Entry.objects.filter(blog_id__exact=4)
|
||||
>>> Entry.objects.filter(blog_id__exact=4)
|
||||
|
||||
If you pass an invalid keyword argument, a lookup function will raise
|
||||
``TypeError``.
|
||||
|
|
|
@ -68,6 +68,3 @@ PostgreSQL and Oracle support tablespaces. SQLite and MySQL don't.
|
|||
|
||||
When you use a backend that lacks support for tablespaces, Django ignores all
|
||||
tablespace-related options.
|
||||
|
||||
.. versionchanged:: 1.4
|
||||
Since Django 1.4, the PostgreSQL backend supports tablespaces.
|
||||
|
|
|
@ -238,9 +238,6 @@ with the PostgreSQL 8, Oracle and MySQL (when using the InnoDB storage engine)
|
|||
backends. Other backends provide the savepoint functions, but they're empty
|
||||
operations -- they don't actually do anything.
|
||||
|
||||
.. versionchanged:: 1.4
|
||||
Savepoint support for the MySQL backend was added in Django 1.4.
|
||||
|
||||
Savepoints aren't especially useful if you are using the default
|
||||
``autocommit`` behavior of Django. However, if you are using
|
||||
``commit_on_success`` or ``commit_manually``, each open transaction will build
|
||||
|
|
|
@ -139,8 +139,6 @@ As we can see, ``formset.errors`` is a list whose entries correspond to the
|
|||
forms in the formset. Validation was performed for each of the two forms, and
|
||||
the expected error message appears for the second item.
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
We can also check if form data differs from the initial data (i.e. the form was
|
||||
sent without any data)::
|
||||
|
||||
|
|
|
@ -625,8 +625,6 @@ exclude::
|
|||
Providing initial values
|
||||
------------------------
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
As with regular formsets, it's possible to :ref:`specify initial data
|
||||
<formsets-initial-data>` for forms in the formset by specifying an ``initial``
|
||||
parameter when instantiating the model formset class returned by
|
||||
|
|
|
@ -39,8 +39,6 @@ a :class:`django.http.HttpResponseNotAllowed` if the conditions are not met.
|
|||
|
||||
.. function:: require_safe()
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
Decorator to require that a view only accept the GET and HEAD methods.
|
||||
These methods are commonly considered "safe" because they should not have
|
||||
the significance of taking an action other than retrieving the requested
|
||||
|
|
|
@ -110,8 +110,6 @@ server has permissions to read and write to this location.
|
|||
Using cookie-based sessions
|
||||
---------------------------
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
To use cookies-based sessions, set the :setting:`SESSION_ENGINE` setting to
|
||||
``"django.contrib.sessions.backends.signed_cookies"``. The session data will be
|
||||
stored using Django's tools for :doc:`cryptographic signing </topics/signing>`
|
||||
|
@ -558,9 +556,6 @@ consistently by all browsers. However, when it is honored, it can be a
|
|||
useful way to mitigate the risk of client side script accessing the
|
||||
protected cookie data.
|
||||
|
||||
.. versionchanged:: 1.4
|
||||
The default value of the setting was changed from ``False`` to ``True``.
|
||||
|
||||
.. _HTTPOnly: https://www.owasp.org/index.php/HTTPOnly
|
||||
|
||||
SESSION_COOKIE_NAME
|
||||
|
|
|
@ -26,10 +26,9 @@ This mapping can be as short or as long as needed. It can reference other
|
|||
mappings. And, because it's pure Python code, it can be constructed
|
||||
dynamically.
|
||||
|
||||
.. versionadded:: 1.4
|
||||
Django also provides a way to translate URLs according to the active
|
||||
language. See the :ref:`internationalization documentation
|
||||
<url-internationalization>` for more information.
|
||||
Django also provides a way to translate URLs according to the active
|
||||
language. See the :ref:`internationalization documentation
|
||||
<url-internationalization>` for more information.
|
||||
|
||||
.. _how-django-processes-a-request:
|
||||
|
||||
|
@ -246,9 +245,6 @@ The variables are:
|
|||
* ``handler500`` -- See :data:`django.conf.urls.handler500`.
|
||||
* ``handler403`` -- See :data:`django.conf.urls.handler403`.
|
||||
|
||||
.. versionadded:: 1.4
|
||||
``handler403`` is new in Django 1.4.
|
||||
|
||||
.. _urlpatterns-view-prefix:
|
||||
|
||||
The view prefix
|
||||
|
|
|
@ -199,8 +199,6 @@ One thing to note about 500 views:
|
|||
The 403 (HTTP Forbidden) view
|
||||
-----------------------------
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
In the same vein as the 404 and 500 views, Django has a view to handle 403
|
||||
Forbidden errors. If a view results in a 403 exception then Django will, by
|
||||
default, call the view ``django.views.defaults.permission_denied``.
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
Time zones
|
||||
==========
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
.. _time-zones-overview:
|
||||
|
||||
Overview
|
||||
|
|
|
@ -287,8 +287,6 @@ will appear in the ``.po`` file as:
|
|||
msgid "May"
|
||||
msgstr ""
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
Contextual markers are also supported by the :ttag:`trans` and
|
||||
:ttag:`blocktrans` template tags.
|
||||
|
||||
|
@ -507,7 +505,6 @@ It's not possible to mix a template variable inside a string within ``{% trans
|
|||
%}``. If your translations require strings with variables (placeholders), use
|
||||
``{% blocktrans %}`` instead.
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
If you'd like to retrieve a translated string without displaying it, you can
|
||||
use the following syntax::
|
||||
|
@ -533,8 +530,6 @@ or should be used as arguments for other template tags or filters::
|
|||
{% endfor %}
|
||||
</p>
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
``{% trans %}`` also supports :ref:`contextual markers<contextual-markers>`
|
||||
using the ``context`` keyword:
|
||||
|
||||
|
@ -574,8 +569,6 @@ You can use multiple expressions inside a single ``blocktrans`` tag::
|
|||
.. note:: The previous more verbose format is still supported:
|
||||
``{% blocktrans with book|title as book_t and author|title as author_t %}``
|
||||
|
||||
.. versionchanged:: 1.4
|
||||
|
||||
If resolving one of the block arguments fails, blocktrans will fall back to
|
||||
the default language by deactivating the currently active language
|
||||
temporarily with the :func:`~django.utils.translation.deactivate_all`
|
||||
|
@ -620,8 +613,6 @@ be retrieved (and stored) beforehand::
|
|||
This is a URL: {{ the_url }}
|
||||
{% endblocktrans %}
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
``{% blocktrans %}`` also supports :ref:`contextual
|
||||
markers<contextual-markers>` using the ``context`` keyword:
|
||||
|
||||
|
@ -1410,8 +1401,6 @@ For example, your :setting:`MIDDLEWARE_CLASSES` might look like this::
|
|||
``LocaleMiddleware`` tries to determine the user's language preference by
|
||||
following this algorithm:
|
||||
|
||||
.. versionchanged:: 1.4
|
||||
|
||||
* First, it looks for the language prefix in the requested URL. This is
|
||||
only performed when you are using the ``i18n_patterns`` function in your
|
||||
root URLconf. See :ref:`url-internationalization` for more information
|
||||
|
|
|
@ -504,8 +504,6 @@ logging module.
|
|||
|
||||
.. class:: CallbackFilter(callback)
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
This filter accepts a callback function (which should accept a single
|
||||
argument, the record to be logged), and calls it for each record that passes
|
||||
through the filter. Handling of that record will not proceed if the callback
|
||||
|
@ -542,8 +540,6 @@ logging module.
|
|||
|
||||
.. class:: RequireDebugFalse()
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
This filter will only pass on records when settings.DEBUG is False.
|
||||
|
||||
This filter is used as follows in the default :setting:`LOGGING`
|
||||
|
|
|
@ -126,12 +126,6 @@ pages along with any interesting information from the objects themselves::
|
|||
</span>
|
||||
</div>
|
||||
|
||||
.. versionchanged:: 1.4
|
||||
Previously, you would need to use
|
||||
``{% for contact in contacts.object_list %}``, since the ``Page``
|
||||
object was not iterable.
|
||||
|
||||
|
||||
``Paginator`` objects
|
||||
=====================
|
||||
|
||||
|
@ -234,7 +228,6 @@ using :meth:`Paginator.page`.
|
|||
|
||||
.. class:: Page(object_list, number, paginator)
|
||||
|
||||
.. versionadded:: 1.4
|
||||
A page acts like a sequence of :attr:`Page.object_list` when using
|
||||
``len()`` or iterating it directly.
|
||||
|
||||
|
|
|
@ -5,8 +5,6 @@ Cryptographic signing
|
|||
.. module:: django.core.signing
|
||||
:synopsis: Django's signing framework.
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
The golden rule of Web application security is to never trust data from
|
||||
untrusted sources. Sometimes it can be useful to pass data through an
|
||||
untrusted medium. Cryptographically signed values can be passed through an
|
||||
|
|
|
@ -242,8 +242,6 @@ set up, execute and tear down the test suite.
|
|||
write your own test runner, ensure accept and handle the ``**kwargs``
|
||||
parameter.
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
Your test runner may also define additional command-line options.
|
||||
If you add an ``option_list`` attribute to a subclassed test runner,
|
||||
those options will be added to the list of command-line options that
|
||||
|
@ -254,8 +252,6 @@ Attributes
|
|||
|
||||
.. attribute:: DjangoTestSuiteRunner.option_list
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
This is the tuple of ``optparse`` options which will be fed into the
|
||||
management command's ``OptionParser`` for parsing arguments. See the
|
||||
documentation for Python's ``optparse`` module for more details.
|
||||
|
|
|
@ -860,8 +860,6 @@ SimpleTestCase
|
|||
|
||||
.. class:: SimpleTestCase()
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
A very thin subclass of :class:`unittest.TestCase`, it extends it with some
|
||||
basic functionality like:
|
||||
|
||||
|
@ -992,8 +990,6 @@ additions, including:
|
|||
LiveServerTestCase
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
.. class:: LiveServerTestCase()
|
||||
|
||||
``LiveServerTestCase`` does basically the same as
|
||||
|
@ -1346,8 +1342,6 @@ Overriding settings
|
|||
|
||||
.. method:: TestCase.settings
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
For testing purposes it's often useful to change a setting temporarily and
|
||||
revert to the original value after running the testing code. For this use case
|
||||
Django provides a standard Python context manager (see :pep:`343`)
|
||||
|
@ -1459,8 +1453,6 @@ your test suite.
|
|||
|
||||
.. method:: SimpleTestCase.assertRaisesMessage(expected_exception, expected_message, callable_obj=None, *args, **kwargs)
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
Asserts that execution of callable ``callable_obj`` raised the
|
||||
``expected_exception`` exception and that such exception has an
|
||||
``expected_message`` representation. Any other outcome is reported as a
|
||||
|
@ -1469,8 +1461,6 @@ your test suite.
|
|||
|
||||
.. method:: SimpleTestCase.assertFieldOutput(self, fieldclass, valid, invalid, field_args=None, field_kwargs=None, empty_value=u'')
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
Asserts that a form field behaves correctly with various inputs.
|
||||
|
||||
:param fieldclass: the class of the field to be tested.
|
||||
|
@ -1495,8 +1485,6 @@ your test suite.
|
|||
that ``text`` appears in the content of the response. If ``count`` is
|
||||
provided, ``text`` must occur exactly ``count`` times in the response.
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
Set ``html`` to ``True`` to handle ``text`` as HTML. The comparison with
|
||||
the response content will be based on HTML semantics instead of
|
||||
character-by-character equality. Whitespace is ignored in most cases,
|
||||
|
@ -1508,8 +1496,6 @@ your test suite.
|
|||
Asserts that a ``Response`` instance produced the given ``status_code`` and
|
||||
that ``text`` does not appears in the content of the response.
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
Set ``html`` to ``True`` to handle ``text`` as HTML. The comparison with
|
||||
the response content will be based on HTML semantics instead of
|
||||
character-by-character equality. Whitespace is ignored in most cases,
|
||||
|
@ -1538,8 +1524,6 @@ your test suite.
|
|||
|
||||
The name is a string such as ``'admin/index.html'``.
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
You can use this as a context manager, like this::
|
||||
|
||||
with self.assertTemplateUsed('index.html'):
|
||||
|
@ -1552,8 +1536,6 @@ your test suite.
|
|||
Asserts that the template with the given name was *not* used in rendering
|
||||
the response.
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
You can use this as a context manager in the same way as
|
||||
:meth:`~TestCase.assertTemplateUsed`.
|
||||
|
||||
|
@ -1580,12 +1562,6 @@ your test suite.
|
|||
provide an implicit ordering, you can set the ``ordered`` parameter to
|
||||
``False``, which turns the comparison into a Python set comparison.
|
||||
|
||||
.. versionchanged:: 1.4
|
||||
The ``ordered`` parameter is new in version 1.4. In earlier versions,
|
||||
you would need to ensure the queryset is ordered consistently, possibly
|
||||
via an explicit ``order_by()`` call on the queryset prior to
|
||||
comparison.
|
||||
|
||||
.. versionchanged:: 1.6
|
||||
The method now checks for undefined order and raises ``ValueError``
|
||||
if undefined order is spotted. The ordering is seen as undefined if
|
||||
|
@ -1612,8 +1588,6 @@ your test suite.
|
|||
|
||||
.. method:: SimpleTestCase.assertHTMLEqual(html1, html2, msg=None)
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
Asserts that the strings ``html1`` and ``html2`` are equal. The comparison
|
||||
is based on HTML semantics. The comparison takes following things into
|
||||
account:
|
||||
|
@ -1643,8 +1617,6 @@ your test suite.
|
|||
|
||||
.. method:: SimpleTestCase.assertHTMLNotEqual(html1, html2, msg=None)
|
||||
|
||||
.. versionadded:: 1.4
|
||||
|
||||
Asserts that the strings ``html1`` and ``html2`` are *not* equal. The
|
||||
comparison is based on HTML semantics. See
|
||||
:meth:`~SimpleTestCase.assertHTMLEqual` for details.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue