mirror of
https://github.com/django/django.git
synced 2025-10-09 10:10:28 +00:00
[1.7.x] Updated doc links to point to Python 3 documentation
Backport of 680a0f08b
from master.
This commit is contained in:
parent
abd68b5aff
commit
e441cebce3
22 changed files with 68 additions and 71 deletions
|
@ -209,8 +209,8 @@ Methods
|
|||
.. method:: AppConfig.get_model(model_name)
|
||||
|
||||
Returns the :class:`~django.db.models.Model` with the given
|
||||
``model_name``. Raises :exc:`~exceptions.LookupError` if no such model
|
||||
exists. ``model_name`` is case-insensitive.
|
||||
``model_name``. Raises :exc:`LookupError` if no such model exists.
|
||||
``model_name`` is case-insensitive.
|
||||
|
||||
.. method:: AppConfig.ready()
|
||||
|
||||
|
@ -284,8 +284,8 @@ Application registry
|
|||
.. method:: apps.get_app_config(app_label)
|
||||
|
||||
Returns an :class:`~django.apps.AppConfig` for the application with the
|
||||
given ``app_label``. Raises :exc:`~exceptions.LookupError` if no such
|
||||
application exists.
|
||||
given ``app_label``. Raises :exc:`LookupError` if no such application
|
||||
exists.
|
||||
|
||||
.. method:: apps.is_installed(app_name)
|
||||
|
||||
|
@ -303,9 +303,9 @@ Application registry
|
|||
argument in the form ``app_label.model_name``. ``model_name`` is case-
|
||||
insensitive.
|
||||
|
||||
Raises :exc:`~exceptions.LookupError` if no such application or model
|
||||
exists. Raises :exc:`~exceptions.ValueError` when called with a single
|
||||
argument that doesn't contain exactly one dot.
|
||||
Raises :exc:`LookupError` if no such application or model exists. Raises
|
||||
:exc:`ValueError` when called with a single argument that doesn't contain
|
||||
exactly one dot.
|
||||
|
||||
.. _applications-troubleshooting:
|
||||
|
||||
|
|
|
@ -290,8 +290,7 @@ Anonymous users
|
|||
* :meth:`~django.contrib.auth.models.User.set_password()`,
|
||||
:meth:`~django.contrib.auth.models.User.check_password()`,
|
||||
:meth:`~django.db.models.Model.save` and
|
||||
:meth:`~django.db.models.Model.delete()` raise
|
||||
:exc:`~exceptions.NotImplementedError`.
|
||||
:meth:`~django.db.models.Model.delete()` raise :exc:`NotImplementedError`.
|
||||
|
||||
In practice, you probably won't need to use
|
||||
:class:`~django.contrib.auth.models.AnonymousUser` objects on your own, but
|
||||
|
|
|
@ -478,7 +478,7 @@ method takes an :class:`~django.http.HttpRequest` object. It's able to deduce
|
|||
the ``domain`` and ``name`` by looking at the request's domain. It has
|
||||
``save()`` and ``delete()`` methods to match the interface of
|
||||
:class:`~django.contrib.sites.models.Site`, but the methods raise
|
||||
:exc:`~exceptions.NotImplementedError`..
|
||||
:exc:`NotImplementedError`.
|
||||
|
||||
``get_current_site`` shortcut
|
||||
=============================
|
||||
|
|
|
@ -225,5 +225,4 @@ Python Exceptions
|
|||
=================
|
||||
|
||||
Django raises built-in Python exceptions when appropriate as well. See the
|
||||
Python documentation for further information on the
|
||||
built-in :mod:`exceptions`.
|
||||
Python documentation for further information on the :ref:`bltin-exceptions`.
|
||||
|
|
|
@ -11,8 +11,8 @@ The ``File`` Class
|
|||
|
||||
.. class:: File(file_object)
|
||||
|
||||
The :class:`File` class is a thin wrapper around Python's :py:ref:`built-in
|
||||
file object<bltin-file-objects>` with some Django-specific additions.
|
||||
The :class:`File` class is a thin wrapper around a Python
|
||||
:py:term:`file object` with some Django-specific additions.
|
||||
Internally, Django uses this class when it needs to represent a file.
|
||||
|
||||
:class:`File` objects have the following attributes and methods:
|
||||
|
@ -28,8 +28,7 @@ The ``File`` Class
|
|||
|
||||
.. attribute:: file
|
||||
|
||||
The underlying :py:ref:`built-in file object<bltin-file-objects>` that
|
||||
this class wraps.
|
||||
The underlying :py:term:`file object` that this class wraps.
|
||||
|
||||
.. attribute:: mode
|
||||
|
||||
|
|
|
@ -666,8 +666,8 @@ Methods
|
|||
|
||||
.. method:: HttpResponse.set_cookie(key, value='', max_age=None, expires=None, path='/', domain=None, secure=None, httponly=False)
|
||||
|
||||
Sets a cookie. The parameters are the same as in the :class:`Cookie.Morsel`
|
||||
object in the Python standard library.
|
||||
Sets a cookie. The parameters are the same as in the
|
||||
:class:`~http.cookies.Morsel` cookie object in the Python standard library.
|
||||
|
||||
* ``max_age`` should be a number of seconds, or ``None`` (default) if
|
||||
the cookie should last only as long as the client's browser session.
|
||||
|
@ -828,7 +828,7 @@ JsonResponse objects
|
|||
The ``safe`` boolean parameter defaults to ``True``. If it's set to ``False``,
|
||||
any object can be passed for serialization (otherwise only ``dict`` instances
|
||||
are allowed). If ``safe`` is ``True`` and a non-``dict`` object is passed as
|
||||
the first argument, a :exc:`~exceptions.TypeError` will be raised.
|
||||
the first argument, a :exc:`TypeError` will be raised.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
@ -849,7 +849,7 @@ parameter to ``False``::
|
|||
|
||||
>>> response = JsonResponse([1, 2, 3], safe=False)
|
||||
|
||||
Without passing ``safe=False``, a :exc:`~exceptions.TypeError` will be raised.
|
||||
Without passing ``safe=False``, a :exc:`TypeError` will be raised.
|
||||
|
||||
.. warning::
|
||||
|
||||
|
|
|
@ -2532,7 +2532,7 @@ slightly different call:
|
|||
The :mod:`staticfiles<django.contrib.staticfiles>` contrib app also ships
|
||||
with a :ttag:`static template tag<staticfiles-static>` which uses
|
||||
``staticfiles'`` :setting:`STATICFILES_STORAGE` to build the URL of the
|
||||
given path (rather than simply using :func:`urlparse.urljoin` with the
|
||||
given path (rather than simply using :func:`urllib.parse.urljoin` with the
|
||||
:setting:`STATIC_URL` setting and the given path). Use that instead if you
|
||||
have an advanced use case such as :ref:`using a cloud service to serve
|
||||
static files<staticfiles-from-cdn>`::
|
||||
|
|
|
@ -133,8 +133,8 @@ results. Instead do::
|
|||
|
||||
The functions defined in this module share the following properties:
|
||||
|
||||
- They raise :exc:`~exceptions.ValueError` if their input is well formatted but
|
||||
isn't a valid date or time.
|
||||
- They raise :exc:`ValueError` if their input is well formatted but isn't a
|
||||
valid date or time.
|
||||
- They return ``None`` if it isn't well formatted at all.
|
||||
- They accept up to picosecond resolution in input, but they truncate it to
|
||||
microseconds, since that's what Python supports.
|
||||
|
@ -692,7 +692,9 @@ escaping HTML.
|
|||
.. function:: int_to_base36(i)
|
||||
|
||||
Converts a positive integer to a base 36 string. On Python 2 ``i`` must be
|
||||
smaller than :data:`sys.maxint`.
|
||||
smaller than `sys.maxint`_.
|
||||
|
||||
.. _sys.maxint: http://docs.python.org/2/library/sys.html#sys.maxint
|
||||
|
||||
.. function:: urlsafe_base64_encode(s)
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ to, or in lieu of custom ``field.clean()`` methods.
|
|||
:param inverse_match: If not ``None``, overrides :attr:`inverse_match`.
|
||||
:param flags: If not ``None``, overrides :attr:`flags`. In that case,
|
||||
:attr:`regex` must be a regular expression string, or
|
||||
:exc:`~exceptions.TypeError` is raised.
|
||||
:exc:`TypeError` is raised.
|
||||
|
||||
.. attribute:: regex
|
||||
|
||||
|
@ -102,7 +102,7 @@ to, or in lieu of custom ``field.clean()`` methods.
|
|||
|
||||
The flags used when compiling the regular expression string :attr:`regex`.
|
||||
If :attr:`regex` is a pre-compiled regular expression, and :attr:`flags` is overridden,
|
||||
:exc:`~exceptions.TypeError` is raised.
|
||||
:exc:`TypeError` is raised.
|
||||
Defaults to `0`.
|
||||
|
||||
``URLValidator``
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue