Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
e441cebc
Kaydet (Commit)
e441cebc
authored
Nis 26, 2014
tarafından
Claude Paroz
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
[1.7.x] Updated doc links to point to Python 3 documentation
Backport of
680a0f08
from master.
üst
abd68b5a
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
68 additions
and
71 deletions
+68
-71
conf.py
docs/conf.py
+2
-2
tutorial01.txt
docs/intro/tutorial01.txt
+1
-1
tutorial04.txt
docs/intro/tutorial04.txt
+2
-2
applications.txt
docs/ref/applications.txt
+7
-7
auth.txt
docs/ref/contrib/auth.txt
+1
-2
sites.txt
docs/ref/contrib/sites.txt
+1
-1
exceptions.txt
docs/ref/exceptions.txt
+1
-2
file.txt
docs/ref/files/file.txt
+3
-4
request-response.txt
docs/ref/request-response.txt
+4
-4
builtins.txt
docs/ref/templates/builtins.txt
+1
-1
utils.txt
docs/ref/utils.txt
+5
-3
validators.txt
docs/ref/validators.txt
+2
-2
1.0-porting-guide.txt
docs/releases/1.0-porting-guide.txt
+4
-4
1.5-alpha-1.txt
docs/releases/1.5-alpha-1.txt
+1
-2
1.5-beta-1.txt
docs/releases/1.5-beta-1.txt
+1
-2
1.5.txt
docs/releases/1.5.txt
+1
-2
1.6.txt
docs/releases/1.6.txt
+1
-1
1.7.txt
docs/releases/1.7.txt
+5
-5
many_to_many.txt
docs/topics/db/examples/many_to_many.txt
+1
-1
timezones.txt
docs/topics/i18n/timezones.txt
+2
-3
python3.txt
docs/topics/python3.txt
+17
-14
tools.txt
docs/topics/testing/tools.txt
+5
-6
No files found.
docs/conf.py
Dosyayı görüntüle @
e441cebc
...
@@ -118,10 +118,10 @@ show_authors = False
...
@@ -118,10 +118,10 @@ show_authors = False
# The name of the Pygments (syntax highlighting) style to use.
# The name of the Pygments (syntax highlighting) style to use.
pygments_style
=
'trac'
pygments_style
=
'trac'
# Links to Python's docs should reference the most recent version of the
2
.x
# Links to Python's docs should reference the most recent version of the
3
.x
# branch, which is located at this URL.
# branch, which is located at this URL.
intersphinx_mapping
=
{
intersphinx_mapping
=
{
'python'
:
(
'http://docs.python.org/'
,
None
),
'python'
:
(
'http://docs.python.org/
3/
'
,
None
),
'sphinx'
:
(
'http://sphinx-doc.org/'
,
None
),
'sphinx'
:
(
'http://sphinx-doc.org/'
,
None
),
'six'
:
(
'http://pythonhosted.org/six/'
,
None
),
'six'
:
(
'http://pythonhosted.org/six/'
,
None
),
'simplejson'
:
(
'http://simplejson.readthedocs.org/en/latest/'
,
None
),
'simplejson'
:
(
'http://simplejson.readthedocs.org/en/latest/'
,
None
),
...
...
docs/intro/tutorial01.txt
Dosyayı görüntüle @
e441cebc
...
@@ -637,7 +637,7 @@ the Python import path to your :file:`mysite/settings.py` file.
...
@@ -637,7 +637,7 @@ the Python import path to your :file:`mysite/settings.py` file.
>>> import django
>>> import django
>>> django.setup()
>>> django.setup()
If this raises an :exc:`
~exceptions.
AttributeError`, you're probably using
If this raises an :exc:`AttributeError`, you're probably using
a version of Django that doesn't match this tutorial version. You'll want
a version of Django that doesn't match this tutorial version. You'll want
to either switch to the older tutorial or the newer Django version.
to either switch to the older tutorial or the newer Django version.
...
...
docs/intro/tutorial04.txt
Dosyayı görüntüle @
e441cebc
...
@@ -106,9 +106,9 @@ This code includes a few things we haven't covered yet in this tutorial:
...
@@ -106,9 +106,9 @@ This code includes a few things we haven't covered yet in this tutorial:
<django.http.HttpRequest.POST>` in our code, to ensure that data is only
<django.http.HttpRequest.POST>` in our code, to ensure that data is only
altered via a POST call.
altered via a POST call.
* ``request.POST['choice']`` will raise :exc:`
~exceptions.
KeyError` if
* ``request.POST['choice']`` will raise :exc:`KeyError` if
``choice`` wasn't provided in POST data. The above code checks for
``choice`` wasn't provided in POST data. The above code checks for
:exc:`
~exceptions.
KeyError` and redisplays the question form with an error
:exc:`KeyError` and redisplays the question form with an error
message if ``choice`` isn't given.
message if ``choice`` isn't given.
* After incrementing the choice count, the code returns an
* After incrementing the choice count, the code returns an
...
...
docs/ref/applications.txt
Dosyayı görüntüle @
e441cebc
...
@@ -209,8 +209,8 @@ Methods
...
@@ -209,8 +209,8 @@ Methods
.. method:: AppConfig.get_model(model_name)
.. method:: AppConfig.get_model(model_name)
Returns the :class:`~django.db.models.Model` with the given
Returns the :class:`~django.db.models.Model` with the given
``model_name``. Raises :exc:`
~exceptions.LookupError` if no such model
``model_name``. Raises :exc:`
LookupError` if no such model exists.
exists.
``model_name`` is case-insensitive.
``model_name`` is case-insensitive.
.. method:: AppConfig.ready()
.. method:: AppConfig.ready()
...
@@ -284,8 +284,8 @@ Application registry
...
@@ -284,8 +284,8 @@ Application registry
.. method:: apps.get_app_config(app_label)
.. method:: apps.get_app_config(app_label)
Returns an :class:`~django.apps.AppConfig` for the application with the
Returns an :class:`~django.apps.AppConfig` for the application with the
given ``app_label``. Raises :exc:`
~exceptions.LookupError` if no such
given ``app_label``. Raises :exc:`
LookupError` if no such application
application
exists.
exists.
.. method:: apps.is_installed(app_name)
.. method:: apps.is_installed(app_name)
...
@@ -303,9 +303,9 @@ Application registry
...
@@ -303,9 +303,9 @@ Application registry
argument in the form ``app_label.model_name``. ``model_name`` is case-
argument in the form ``app_label.model_name``. ``model_name`` is case-
insensitive.
insensitive.
Raises :exc:`
~exceptions.LookupError` if no such application or model
Raises :exc:`
LookupError` if no such application or model exists. Raises
exists. Raises :exc:`~exceptions.ValueError` when called with a single
:exc:`ValueError` when called with a single argument that doesn't contain
argument that doesn't contain
exactly one dot.
exactly one dot.
.. _applications-troubleshooting:
.. _applications-troubleshooting:
...
...
docs/ref/contrib/auth.txt
Dosyayı görüntüle @
e441cebc
...
@@ -290,8 +290,7 @@ Anonymous users
...
@@ -290,8 +290,7 @@ Anonymous users
* :meth:`~django.contrib.auth.models.User.set_password()`,
* :meth:`~django.contrib.auth.models.User.set_password()`,
:meth:`~django.contrib.auth.models.User.check_password()`,
:meth:`~django.contrib.auth.models.User.check_password()`,
:meth:`~django.db.models.Model.save` and
:meth:`~django.db.models.Model.save` and
:meth:`~django.db.models.Model.delete()` raise
:meth:`~django.db.models.Model.delete()` raise :exc:`NotImplementedError`.
:exc:`~exceptions.NotImplementedError`.
In practice, you probably won't need to use
In practice, you probably won't need to use
:class:`~django.contrib.auth.models.AnonymousUser` objects on your own, but
:class:`~django.contrib.auth.models.AnonymousUser` objects on your own, but
...
...
docs/ref/contrib/sites.txt
Dosyayı görüntüle @
e441cebc
...
@@ -478,7 +478,7 @@ method takes an :class:`~django.http.HttpRequest` object. It's able to deduce
...
@@ -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
the ``domain`` and ``name`` by looking at the request's domain. It has
``save()`` and ``delete()`` methods to match the interface of
``save()`` and ``delete()`` methods to match the interface of
:class:`~django.contrib.sites.models.Site`, but the methods raise
:class:`~django.contrib.sites.models.Site`, but the methods raise
:exc:`
~exceptions.NotImplementedError`.
.
:exc:`
NotImplementedError`
.
``get_current_site`` shortcut
``get_current_site`` shortcut
=============================
=============================
...
...
docs/ref/exceptions.txt
Dosyayı görüntüle @
e441cebc
...
@@ -225,5 +225,4 @@ Python Exceptions
...
@@ -225,5 +225,4 @@ Python Exceptions
=================
=================
Django raises built-in Python exceptions when appropriate as well. See the
Django raises built-in Python exceptions when appropriate as well. See the
Python documentation for further information on the
Python documentation for further information on the :ref:`bltin-exceptions`.
built-in :mod:`exceptions`.
docs/ref/files/file.txt
Dosyayı görüntüle @
e441cebc
...
@@ -11,8 +11,8 @@ The ``File`` Class
...
@@ -11,8 +11,8 @@ The ``File`` Class
.. class:: File(file_object)
.. class:: File(file_object)
The :class:`File` class is a thin wrapper around
Python's :py:ref:`built-i
n
The :class:`File` class is a thin wrapper around
a Pytho
n
file object<bltin-file-objects>
` with some Django-specific additions.
:py:term:`file object
` with some Django-specific additions.
Internally, Django uses this class when it needs to represent a file.
Internally, Django uses this class when it needs to represent a file.
:class:`File` objects have the following attributes and methods:
:class:`File` objects have the following attributes and methods:
...
@@ -28,8 +28,7 @@ The ``File`` Class
...
@@ -28,8 +28,7 @@ The ``File`` Class
.. attribute:: file
.. attribute:: file
The underlying :py:ref:`built-in file object<bltin-file-objects>` that
The underlying :py:term:`file object` that this class wraps.
this class wraps.
.. attribute:: mode
.. attribute:: mode
...
...
docs/ref/request-response.txt
Dosyayı görüntüle @
e441cebc
...
@@ -666,8 +666,8 @@ Methods
...
@@ -666,8 +666,8 @@ Methods
.. method:: HttpResponse.set_cookie(key, value='', max_age=None, expires=None, path='/', domain=None, secure=None, httponly=False)
.. 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`
Sets a cookie. The parameters are the same as in the
object in the Python standard library.
:class:`~http.cookies.Morsel` cookie
object in the Python standard library.
* ``max_age`` should be a number of seconds, or ``None`` (default) if
* ``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.
the cookie should last only as long as the client's browser session.
...
@@ -828,7 +828,7 @@ JsonResponse objects
...
@@ -828,7 +828,7 @@ JsonResponse objects
The ``safe`` boolean parameter defaults to ``True``. If it's set to ``False``,
The ``safe`` boolean parameter defaults to ``True``. If it's set to ``False``,
any object can be passed for serialization (otherwise only ``dict`` instances
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
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
Usage
-----
-----
...
@@ -849,7 +849,7 @@ parameter to ``False``::
...
@@ -849,7 +849,7 @@ parameter to ``False``::
>>> response = JsonResponse([1, 2, 3], safe=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::
.. warning::
...
...
docs/ref/templates/builtins.txt
Dosyayı görüntüle @
e441cebc
...
@@ -2532,7 +2532,7 @@ slightly different call:
...
@@ -2532,7 +2532,7 @@ slightly different call:
The :mod:`staticfiles<django.contrib.staticfiles>` contrib app also ships
The :mod:`staticfiles<django.contrib.staticfiles>` contrib app also ships
with a :ttag:`static template tag<staticfiles-static>` which uses
with a :ttag:`static template tag<staticfiles-static>` which uses
``staticfiles'`` :setting:`STATICFILES_STORAGE` to build the URL of the
``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:`url
lib.
parse.urljoin` with the
:setting:`STATIC_URL` setting and the given path). Use that instead if you
: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
have an advanced use case such as :ref:`using a cloud service to serve
static files<staticfiles-from-cdn>`::
static files<staticfiles-from-cdn>`::
...
...
docs/ref/utils.txt
Dosyayı görüntüle @
e441cebc
...
@@ -133,8 +133,8 @@ results. Instead do::
...
@@ -133,8 +133,8 @@ results. Instead do::
The functions defined in this module share the following properties:
The functions defined in this module share the following properties:
- They raise :exc:`
~exceptions.ValueError` if their input is well formatted but
- They raise :exc:`
ValueError` if their input is well formatted but isn't a
isn't a
valid date or time.
valid date or time.
- They return ``None`` if it isn't well formatted at all.
- They return ``None`` if it isn't well formatted at all.
- They accept up to picosecond resolution in input, but they truncate it to
- They accept up to picosecond resolution in input, but they truncate it to
microseconds, since that's what Python supports.
microseconds, since that's what Python supports.
...
@@ -692,7 +692,9 @@ escaping HTML.
...
@@ -692,7 +692,9 @@ escaping HTML.
.. function:: int_to_base36(i)
.. function:: int_to_base36(i)
Converts a positive integer to a base 36 string. On Python 2 ``i`` must be
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)
.. function:: urlsafe_base64_encode(s)
...
...
docs/ref/validators.txt
Dosyayı görüntüle @
e441cebc
...
@@ -68,7 +68,7 @@ to, or in lieu of custom ``field.clean()`` methods.
...
@@ -68,7 +68,7 @@ to, or in lieu of custom ``field.clean()`` methods.
:param inverse_match: If not ``None``, overrides :attr:`inverse_match`.
:param inverse_match: If not ``None``, overrides :attr:`inverse_match`.
:param flags: If not ``None``, overrides :attr:`flags`. In that case,
:param flags: If not ``None``, overrides :attr:`flags`. In that case,
:attr:`regex` must be a regular expression string, or
:attr:`regex` must be a regular expression string, or
:exc:`
~exceptions.
TypeError` is raised.
:exc:`TypeError` is raised.
.. attribute:: regex
.. attribute:: regex
...
@@ -102,7 +102,7 @@ to, or in lieu of custom ``field.clean()`` methods.
...
@@ -102,7 +102,7 @@ to, or in lieu of custom ``field.clean()`` methods.
The flags used when compiling the regular expression string :attr:`regex`.
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,
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`.
Defaults to `0`.
``URLValidator``
``URLValidator``
...
...
docs/releases/1.0-porting-guide.txt
Dosyayı görüntüle @
e441cebc
...
@@ -440,9 +440,9 @@ Settings
...
@@ -440,9 +440,9 @@ Settings
Better exceptions
Better exceptions
~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~
The old :exc:`
~exceptions.
EnvironmentError` has split into an
The old :exc:`EnvironmentError` has split into an
:exc:`
~exceptions.
ImportError` when Django fails to find the settings module
:exc:`ImportError` when Django fails to find the settings module
and a :exc:`
~exceptions.
RuntimeError` when you try to reconfigure settings
and a :exc:`RuntimeError` when you try to reconfigure settings
after having already used them.
after having already used them.
:setting:`LOGIN_URL` has moved
:setting:`LOGIN_URL` has moved
...
@@ -479,7 +479,7 @@ Different exception from ``get()``
...
@@ -479,7 +479,7 @@ Different exception from ``get()``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Managers now return a :exc:`~django.core.exceptions.MultipleObjectsReturned`
Managers now return a :exc:`~django.core.exceptions.MultipleObjectsReturned`
exception instead of :exc:`
~exceptions.
AssertionError`:
exception instead of :exc:`AssertionError`:
Old (0.96)::
Old (0.96)::
...
...
docs/releases/1.5-alpha-1.txt
Dosyayı görüntüle @
e441cebc
...
@@ -550,8 +550,7 @@ Miscellaneous
...
@@ -550,8 +550,7 @@ Miscellaneous
``QuerySet`` as the empty value instead of an empty list.
``QuerySet`` as the empty value instead of an empty list.
* :func:`~django.utils.http.int_to_base36` properly raises a
* :func:`~django.utils.http.int_to_base36` properly raises a
:exc:`~exceptions.TypeError` instead of :exc:`~exceptions.ValueError` for
:exc:`TypeError` instead of :exc:`ValueError` for non-integer inputs.
non-integer inputs.
* The ``slugify`` template filter is now available as a standard python
* The ``slugify`` template filter is now available as a standard python
function at :func:`django.utils.text.slugify`. Similarly, ``remove_tags`` is
function at :func:`django.utils.text.slugify`. Similarly, ``remove_tags`` is
...
...
docs/releases/1.5-beta-1.txt
Dosyayı görüntüle @
e441cebc
...
@@ -589,8 +589,7 @@ Miscellaneous
...
@@ -589,8 +589,7 @@ Miscellaneous
``QuerySet`` as the empty value instead of an empty list.
``QuerySet`` as the empty value instead of an empty list.
* :func:`~django.utils.http.int_to_base36` properly raises a
* :func:`~django.utils.http.int_to_base36` properly raises a
:exc:`~exceptions.TypeError` instead of :exc:`~exceptions.ValueError` for
:exc:`TypeError` instead of :exc:`ValueError` for non-integer inputs.
non-integer inputs.
* The ``slugify`` template filter is now available as a standard python
* The ``slugify`` template filter is now available as a standard python
function at :func:`django.utils.text.slugify`. Similarly, ``remove_tags`` is
function at :func:`django.utils.text.slugify`. Similarly, ``remove_tags`` is
...
...
docs/releases/1.5.txt
Dosyayı görüntüle @
e441cebc
...
@@ -667,8 +667,7 @@ Miscellaneous
...
@@ -667,8 +667,7 @@ Miscellaneous
``QuerySet`` as the empty value instead of an empty list.
``QuerySet`` as the empty value instead of an empty list.
* :func:`~django.utils.http.int_to_base36` properly raises a
* :func:`~django.utils.http.int_to_base36` properly raises a
:exc:`~exceptions.TypeError` instead of :exc:`~exceptions.ValueError` for
:exc:`TypeError` instead of :exc:`ValueError` for non-integer inputs.
non-integer inputs.
* The ``slugify`` template filter is now available as a standard python
* The ``slugify`` template filter is now available as a standard python
function at :func:`django.utils.text.slugify`. Similarly, ``remove_tags`` is
function at :func:`django.utils.text.slugify`. Similarly, ``remove_tags`` is
...
...
docs/releases/1.6.txt
Dosyayı görüntüle @
e441cebc
...
@@ -168,7 +168,7 @@ Minor features
...
@@ -168,7 +168,7 @@ Minor features
:setting:`CSRF_COOKIE_HTTPONLY`.
:setting:`CSRF_COOKIE_HTTPONLY`.
* The :meth:`~django.test.TransactionTestCase.assertQuerysetEqual` now checks
* The :meth:`~django.test.TransactionTestCase.assertQuerysetEqual` now checks
for undefined order and raises :exc:`
~exceptions.
ValueError` if undefined
for undefined order and raises :exc:`ValueError` if undefined
order is spotted. The order is seen as undefined if the given ``QuerySet``
order is spotted. The order is seen as undefined if the given ``QuerySet``
isn't ordered and there are more than one ordered values to compare against.
isn't ordered and there are more than one ordered values to compare against.
...
...
docs/releases/1.7.txt
Dosyayı görüntüle @
e441cebc
...
@@ -944,8 +944,8 @@ the app cache was a private API, obsolete methods and arguments will be
...
@@ -944,8 +944,8 @@ the app cache was a private API, obsolete methods and arguments will be
removed through a standard deprecation path, with the exception of the
removed through a standard deprecation path, with the exception of the
following changes that take effect immediately:
following changes that take effect immediately:
* ``get_model`` raises :exc:`
~exceptions.LookupError` instead of returning
* ``get_model`` raises :exc:`
LookupError` instead of returning ``None`` when no
``None`` when no
model is found.
model is found.
* The ``only_installed`` argument of ``get_model`` and ``get_models`` no
* The ``only_installed`` argument of ``get_model`` and ``get_models`` no
longer exists, nor does the ``seed_cache`` argument of ``get_model``.
longer exists, nor does the ``seed_cache`` argument of ``get_model``.
...
@@ -1005,9 +1005,9 @@ pytz may be required
...
@@ -1005,9 +1005,9 @@ pytz may be required
~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~
If your project handles datetimes before 1970 or after 2037 and Django raises
If your project handles datetimes before 1970 or after 2037 and Django raises
a :exc:`
~exceptions.ValueError` when encountering them, you will have to
a :exc:`
ValueError` when encountering them, you will have to install pytz_. You
install pytz_. You may be affected by this problem if you use Django's tim
e
may be affected by this problem if you use Django's time zone-related dat
e
zone-related date
formats or :mod:`django.contrib.syndication`.
formats or :mod:`django.contrib.syndication`.
.. _pytz: https://pypi.python.org/pypi/pytz/
.. _pytz: https://pypi.python.org/pypi/pytz/
...
...
docs/topics/db/examples/many_to_many.txt
Dosyayı görüntüle @
e441cebc
...
@@ -78,7 +78,7 @@ Adding a second time is OK::
...
@@ -78,7 +78,7 @@ Adding a second time is OK::
>>> a2.publications.add(p3)
>>> a2.publications.add(p3)
Adding an object of the wrong type raises :exc:`
~exceptions.
TypeError`::
Adding an object of the wrong type raises :exc:`TypeError`::
>>> a2.publications.add(a1)
>>> a2.publications.add(a1)
Traceback (most recent call last):
Traceback (most recent call last):
...
...
docs/topics/i18n/timezones.txt
Dosyayı görüntüle @
e441cebc
...
@@ -460,9 +460,8 @@ zone support.
...
@@ -460,9 +460,8 @@ zone support.
Fixtures generated with ``USE_TZ = False``, or before Django 1.4, use the
Fixtures generated with ``USE_TZ = False``, or before Django 1.4, use the
"naive" format. If your project contains such fixtures, after you enable time
"naive" format. If your project contains such fixtures, after you enable time
zone support, you'll see :exc:`~exceptions.RuntimeWarning`\ s when you load
zone support, you'll see :exc:`RuntimeWarning`\ s when you load them. To get
them. To get rid of the warnings, you must convert your fixtures to the "aware"
rid of the warnings, you must convert your fixtures to the "aware" format.
format.
You can regenerate fixtures with :djadmin:`loaddata` then :djadmin:`dumpdata`.
You can regenerate fixtures with :djadmin:`loaddata` then :djadmin:`dumpdata`.
Or, if they're small enough, you can simply edit them to add the UTC offset
Or, if they're small enough, you can simply edit them to add the UTC offset
...
...
docs/topics/python3.txt
Dosyayı görüntüle @
e441cebc
...
@@ -78,8 +78,8 @@ wherever possible and avoid the ``b`` prefixes.
...
@@ -78,8 +78,8 @@ wherever possible and avoid the ``b`` prefixes.
String handling
String handling
---------------
---------------
Python 2's
:func:`unicode` type was renamed :func
:`str` in Python 3,
Python 2's
`unicode`_ type was renamed :class
:`str` in Python 3,
:func:`str` was renamed ``bytes()``, and :func:`basestring`
disappeared.
``str()`` was renamed :func:`bytes`, and `basestring`_
disappeared.
six_ provides :ref:`tools <string-handling-with-six>` to deal with these
six_ provides :ref:`tools <string-handling-with-six>` to deal with these
changes.
changes.
...
@@ -131,35 +131,34 @@ and ``SafeText`` respectively.
...
@@ -131,35 +131,34 @@ and ``SafeText`` respectively.
For forwards compatibility, the new names work as of Django 1.4.2.
For forwards compatibility, the new names work as of Django 1.4.2.
:meth:`~object.__str__` and
:meth:`~object.__unicode__`
methods
:meth:`~object.__str__` and
` __unicode__()`_
methods
-----------------------------------------------------
----------
-----------------------------------------------------
In Python 2, the object model specifies :meth:`~object.__str__` and
In Python 2, the object model specifies :meth:`~object.__str__` and
:meth:`~object.__unicode__`
methods. If these methods exist, they must return
` __unicode__()`_
methods. If these methods exist, they must return
``str`` (bytes) and ``unicode`` (text) respectively.
``str`` (bytes) and ``unicode`` (text) respectively.
The ``print`` statement and the :
func
:`str` built-in call
The ``print`` statement and the :
class
:`str` built-in call
:meth:`~object.__str__` to determine the human-readable representation of an
:meth:`~object.__str__` to determine the human-readable representation of an
object. The
:func:`unicode` built-in calls :meth:`~object.__unicode__`
if it
object. The
``unicode`` built-in calls ` __unicode__()`_
if it
exists, and otherwise falls back to :meth:`~object.__str__` and decodes the
exists, and otherwise falls back to :meth:`~object.__str__` and decodes the
result with the system encoding. Conversely, the
result with the system encoding. Conversely, the
:class:`~django.db.models.Model` base class automatically derives
:class:`~django.db.models.Model` base class automatically derives
:meth:`~object.__str__` from
:meth:`~object.__unicode__`
by encoding to UTF-8.
:meth:`~object.__str__` from
` __unicode__()`_
by encoding to UTF-8.
In Python 3, there's simply :meth:`~object.__str__`, which must return ``str``
In Python 3, there's simply :meth:`~object.__str__`, which must return ``str``
(text).
(text).
(It is also possible to define ``__bytes__()``, but Django application have
(It is also possible to define :meth:`~object.__bytes__`, but Django application
little use for that method, because they hardly ever deal with
have little use for that method, because they hardly ever deal with ``bytes``.)
``bytes``.)
Django provides a simple way to define :meth:`~object.__str__` and
Django provides a simple way to define :meth:`~object.__str__` and
:meth:`~object.__unicode__`
methods that work on Python 2 and 3: you must
` __unicode__()`_
methods that work on Python 2 and 3: you must
define a :meth:`~object.__str__` method returning text and to apply the
define a :meth:`~object.__str__` method returning text and to apply the
:func:`~django.utils.encoding.python_2_unicode_compatible` decorator.
:func:`~django.utils.encoding.python_2_unicode_compatible` decorator.
On Python 3, the decorator is a no-op. On Python 2, it defines appropriate
On Python 3, the decorator is a no-op. On Python 2, it defines appropriate
:meth:`~object.__unicode__`
and :meth:`~object.__str__` methods (replacing the
` __unicode__()`_
and :meth:`~object.__str__` methods (replacing the
original :meth:`~object.__str__` method in the process). Here's an example::
original :meth:`~object.__str__` method in the process). Here's an example::
from __future__ import unicode_literals
from __future__ import unicode_literals
...
@@ -233,7 +232,7 @@ In order to enable the same behavior in Python 2, every module must import
...
@@ -233,7 +232,7 @@ In order to enable the same behavior in Python 2, every module must import
my_bytestring = b"This is a bytestring"
my_bytestring = b"This is a bytestring"
If you need a byte string literal under Python 2 and a unicode string literal
If you need a byte string literal under Python 2 and a unicode string literal
under Python 3, use the :
func
:`str` builtin::
under Python 3, use the :
class
:`str` builtin::
str('my string')
str('my string')
...
@@ -402,3 +401,7 @@ extras.
...
@@ -402,3 +401,7 @@ extras.
In addition to six' defaults moves, Django's version provides ``thread`` as
In addition to six' defaults moves, Django's version provides ``thread`` as
``_thread`` and ``dummy_thread`` as ``_dummy_thread``.
``_thread`` and ``dummy_thread`` as ``_dummy_thread``.
.. _unicode: http://docs.python.org/2/library/functions.html#unicode
.. _ __unicode__(): https://docs.python.org/2/reference/datamodel.html#object.__unicode__
.. _basestring: http://docs.python.org/2/library/functions.html#basestring
docs/topics/testing/tools.txt
Dosyayı görüntüle @
e441cebc
...
@@ -77,8 +77,7 @@ Note a few important things about how the test client works:
...
@@ -77,8 +77,7 @@ Note a few important things about how the test client works:
The test client is not capable of retrieving Web pages that are not
The test client is not capable of retrieving Web pages that are not
powered by your Django project. If you need to retrieve other Web pages,
powered by your Django project. If you need to retrieve other Web pages,
use a Python standard library module such as :mod:`urllib` or
use a Python standard library module such as :mod:`urllib`.
:mod:`urllib2`.
* To resolve URLs, the test client uses whatever URLconf is pointed-to by
* To resolve URLs, the test client uses whatever URLconf is pointed-to by
your :setting:`ROOT_URLCONF` setting.
your :setting:`ROOT_URLCONF` setting.
...
@@ -479,9 +478,9 @@ can access these properties as part of a test condition.
...
@@ -479,9 +478,9 @@ can access these properties as part of a test condition.
.. attribute:: Client.cookies
.. attribute:: Client.cookies
A Python :class:`~
Cookie.SimpleCookie` object, containing the current values
A Python :class:`~
http.cookies.SimpleCookie` object, containing the current
of all the client cookies. See the documentation of the :mod:`Cookie` modul
e
values of all the client cookies. See the documentation of th
e
for more.
:mod:`http.cookies` module
for more.
.. attribute:: Client.session
.. attribute:: Client.session
...
@@ -1247,7 +1246,7 @@ your test suite.
...
@@ -1247,7 +1246,7 @@ your test suite.
Asserts that execution of callable ``callable_obj`` raised the
Asserts that execution of callable ``callable_obj`` raised the
``expected_exception`` exception and that such exception has an
``expected_exception`` exception and that such exception has an
``expected_message`` representation. Any other outcome is reported as a
``expected_message`` representation. Any other outcome is reported as a
failure. Similar to unittest's :meth:`~unittest.TestCase.assertRaisesRegex
p
`
failure. Similar to unittest's :meth:`~unittest.TestCase.assertRaisesRegex`
with the difference that ``expected_message`` isn't a regular expression.
with the difference that ``expected_message`` isn't a regular expression.
.. method:: SimpleTestCase.assertFieldOutput(fieldclass, valid, invalid, field_args=None, field_kwargs=None, empty_value=u'')
.. method:: SimpleTestCase.assertFieldOutput(fieldclass, valid, invalid, field_args=None, field_kwargs=None, empty_value=u'')
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment