[1.3.X] Fixed #16014 -- numerous documentation typos -- thanks psmith.
Backport of r16220 from trunk. git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.3.X@16221 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
fc39163177
commit
8385b31c89
|
@ -71,7 +71,7 @@ The new custom command can be called using ``python manage.py closepoll
|
||||||
<poll_id>``.
|
<poll_id>``.
|
||||||
|
|
||||||
The ``handle()`` method takes zero or more ``poll_ids`` and sets ``poll.opened``
|
The ``handle()`` method takes zero or more ``poll_ids`` and sets ``poll.opened``
|
||||||
to ``False`` for each one. If the user referenced any nonexistant polls, a
|
to ``False`` for each one. If the user referenced any nonexistent polls, a
|
||||||
:class:`CommandError` is raised. The ``poll.opened`` attribute does not exist
|
:class:`CommandError` is raised. The ``poll.opened`` attribute does not exist
|
||||||
in the :doc:`tutorial</intro/tutorial01>` and was added to
|
in the :doc:`tutorial</intro/tutorial01>` and was added to
|
||||||
``polls.models.Poll`` for this example.
|
``polls.models.Poll`` for this example.
|
||||||
|
|
|
@ -829,7 +829,7 @@ Here's how you'd use this new version of the tag:
|
||||||
.. admonition:: Variable scope in context
|
.. admonition:: Variable scope in context
|
||||||
|
|
||||||
Any variable set in the context will only be available in the same ``block``
|
Any variable set in the context will only be available in the same ``block``
|
||||||
of the template in which it was assigned. This behaviour is intentional;
|
of the template in which it was assigned. This behavior is intentional;
|
||||||
it provides a scope for variables so that they don't conflict with
|
it provides a scope for variables so that they don't conflict with
|
||||||
context in other blocks.
|
context in other blocks.
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ At this point, Django on Jython should behave nearly identically to Django
|
||||||
running on standard Python. However, are a few differences to keep in mind:
|
running on standard Python. However, are a few differences to keep in mind:
|
||||||
|
|
||||||
* Remember to use the ``jython`` command instead of ``python``. The
|
* Remember to use the ``jython`` command instead of ``python``. The
|
||||||
documentation uses ``python`` for consistancy, but if you're using Jython
|
documentation uses ``python`` for consistency, but if you're using Jython
|
||||||
you'll want to mentally replace ``python`` with ``jython`` every time it
|
you'll want to mentally replace ``python`` with ``jython`` every time it
|
||||||
occurs.
|
occurs.
|
||||||
|
|
||||||
|
|
|
@ -137,7 +137,7 @@ A far better way is to use the value of the :setting:`STATIC_URL` setting
|
||||||
directly in your templates. This means that a switch of static files servers
|
directly in your templates. This means that a switch of static files servers
|
||||||
only requires changing that single value. Much better!
|
only requires changing that single value. Much better!
|
||||||
|
|
||||||
``staticfiles`` inludes two built-in ways of getting at this setting in your
|
``staticfiles`` includes two built-in ways of getting at this setting in your
|
||||||
templates: a context processor and a template tag.
|
templates: a context processor and a template tag.
|
||||||
|
|
||||||
With a context processor
|
With a context processor
|
||||||
|
@ -170,7 +170,7 @@ As a brief refresher, context processors add variables into the contexts of
|
||||||
every template. However, context processors require that you use
|
every template. However, context processors require that you use
|
||||||
:class:`~django.template.RequestContext` when rendering templates. This happens
|
:class:`~django.template.RequestContext` when rendering templates. This happens
|
||||||
automatically if you're using a :doc:`generic view </ref/class-based-views>`,
|
automatically if you're using a :doc:`generic view </ref/class-based-views>`,
|
||||||
but in views written by hand you'll need to explicitally use ``RequestContext``
|
but in views written by hand you'll need to explicitly use ``RequestContext``
|
||||||
To see how that works, and to read more details, check out
|
To see how that works, and to read more details, check out
|
||||||
:ref:`subclassing-context-requestcontext`.
|
:ref:`subclassing-context-requestcontext`.
|
||||||
|
|
||||||
|
@ -439,7 +439,7 @@ For example, if you've written an S3 storage backend in
|
||||||
|
|
||||||
Once that's done, all you have to do is run :djadmin:`collectstatic` and your
|
Once that's done, all you have to do is run :djadmin:`collectstatic` and your
|
||||||
static files would be pushed through your storage package up to S3. If you
|
static files would be pushed through your storage package up to S3. If you
|
||||||
later needed to swich to a different storage provider, it could be as simple
|
later needed to switch to a different storage provider, it could be as simple
|
||||||
as changing your :setting:`STATICFILES_STORAGE` setting.
|
as changing your :setting:`STATICFILES_STORAGE` setting.
|
||||||
|
|
||||||
For details on how you'd write one of these backends,
|
For details on how you'd write one of these backends,
|
||||||
|
|
|
@ -472,7 +472,7 @@ to do:
|
||||||
* Then, click the "Join this Team" button to become a member of this team.
|
* Then, click the "Join this Team" button to become a member of this team.
|
||||||
Every team has at least one coordinator who is responsible to review
|
Every team has at least one coordinator who is responsible to review
|
||||||
your membership request. You can of course also contact the team
|
your membership request. You can of course also contact the team
|
||||||
coordinator to clarify procedual problems and handle the actual
|
coordinator to clarify procedural problems and handle the actual
|
||||||
translation process.
|
translation process.
|
||||||
|
|
||||||
* Once you are a member of a team choose the translation resource you
|
* Once you are a member of a team choose the translation resource you
|
||||||
|
|
|
@ -20,7 +20,7 @@ their deprecation, as per the :ref:`Django deprecation policy
|
||||||
|
|
||||||
* 1.4
|
* 1.4
|
||||||
* ``CsrfResponseMiddleware``. This has been deprecated since the 1.2
|
* ``CsrfResponseMiddleware``. This has been deprecated since the 1.2
|
||||||
release, in favour of the template tag method for inserting the CSRF
|
release, in favor of the template tag method for inserting the CSRF
|
||||||
token. ``CsrfMiddleware``, which combines ``CsrfResponseMiddleware``
|
token. ``CsrfMiddleware``, which combines ``CsrfResponseMiddleware``
|
||||||
and ``CsrfViewMiddleware``, is also deprecated.
|
and ``CsrfViewMiddleware``, is also deprecated.
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@ their deprecation, as per the :ref:`Django deprecation policy
|
||||||
|
|
||||||
* The undocumented function
|
* The undocumented function
|
||||||
:func:`django.contrib.formtools.utils.security_hash`
|
:func:`django.contrib.formtools.utils.security_hash`
|
||||||
is deprecated, in favour of :func:`django.contrib.formtools.utils.form_hmac`
|
is deprecated, in favor of :func:`django.contrib.formtools.utils.form_hmac`
|
||||||
|
|
||||||
* The function-based generic views have been deprecated in
|
* The function-based generic views have been deprecated in
|
||||||
favor of their class-based cousins. The following modules
|
favor of their class-based cousins. The following modules
|
||||||
|
@ -158,7 +158,7 @@ their deprecation, as per the :ref:`Django deprecation policy
|
||||||
a :class:`~django.contrib.gis.geos.GEOSException` when called
|
a :class:`~django.contrib.gis.geos.GEOSException` when called
|
||||||
on a geometry with no SRID value.
|
on a geometry with no SRID value.
|
||||||
|
|
||||||
* :class:`~django.http.CompatCookie` will be removed in favour of
|
* :class:`~django.http.CompatCookie` will be removed in favor of
|
||||||
:class:`~django.http.SimpleCookie`.
|
:class:`~django.http.SimpleCookie`.
|
||||||
|
|
||||||
* :class:`django.core.context_processors.PermWrapper` and
|
* :class:`django.core.context_processors.PermWrapper` and
|
||||||
|
|
|
@ -199,7 +199,7 @@ branch ``django/branches/releases/1.0.X`` was created to receive bug
|
||||||
fixes, and shortly after the release of Django 1.1 the branch
|
fixes, and shortly after the release of Django 1.1 the branch
|
||||||
``django/branches/releases/1.1.X`` was created.
|
``django/branches/releases/1.1.X`` was created.
|
||||||
|
|
||||||
Prior to the Django 1.0 release, these branches were maintaind within
|
Prior to the Django 1.0 release, these branches were maintained within
|
||||||
the top-level ``django/branches`` directory, and so the following
|
the top-level ``django/branches`` directory, and so the following
|
||||||
branches exist there and provided support for older Django releases:
|
branches exist there and provided support for older Django releases:
|
||||||
|
|
||||||
|
|
|
@ -593,7 +593,7 @@ automatically-generated admin.
|
||||||
Unicode string, and ``str(p)`` will return a normal string, with characters
|
Unicode string, and ``str(p)`` will return a normal string, with characters
|
||||||
encoded as UTF-8.
|
encoded as UTF-8.
|
||||||
|
|
||||||
If all of this is jibberish to you, just remember to add
|
If all of this is gibberish to you, just remember to add
|
||||||
:meth:`~django.db.models.Model.__unicode__` methods to your models. With any
|
:meth:`~django.db.models.Model.__unicode__` methods to your models. With any
|
||||||
luck, things should Just Work for you.
|
luck, things should Just Work for you.
|
||||||
|
|
||||||
|
|
|
@ -361,6 +361,6 @@ considering aren't valid, we must remember to remove them from the
|
||||||
``cleaned_data``.
|
``cleaned_data``.
|
||||||
|
|
||||||
In fact, Django will currently completely wipe out the ``cleaned_data``
|
In fact, Django will currently completely wipe out the ``cleaned_data``
|
||||||
dictionary if there are any errors in the form. However, this behaviour may
|
dictionary if there are any errors in the form. However, this behavior may
|
||||||
change in the future, so it's not a bad idea to clean up after yourself in the
|
change in the future, so it's not a bad idea to clean up after yourself in the
|
||||||
first place.
|
first place.
|
||||||
|
|
|
@ -1084,7 +1084,7 @@ If you have a field named ``defaults`` and want to use it as an exact lookup in
|
||||||
Foo.objects.get_or_create(defaults__exact='bar', defaults={'defaults': 'baz'})
|
Foo.objects.get_or_create(defaults__exact='bar', defaults={'defaults': 'baz'})
|
||||||
|
|
||||||
|
|
||||||
The ``get_or_create()`` method has similar error behaviour to ``create()``
|
The ``get_or_create()`` method has similar error behavior to ``create()``
|
||||||
when you are using manually specified primary keys. If an object needs to be
|
when you are using manually specified primary keys. If an object needs to be
|
||||||
created and the key already exists in the database, an ``IntegrityError`` will
|
created and the key already exists in the database, an ``IntegrityError`` will
|
||||||
be raised.
|
be raised.
|
||||||
|
|
|
@ -27,7 +27,7 @@ The :mod:`~django.contrib.staticfiles` app ships with the ability to
|
||||||
automatically serve static files during development (if the :setting:`DEBUG`
|
automatically serve static files during development (if the :setting:`DEBUG`
|
||||||
setting is ``True``) when using the :djadmin:`runserver` management command.
|
setting is ``True``) when using the :djadmin:`runserver` management command.
|
||||||
Based on feedback from the community this release adds two new options to the
|
Based on feedback from the community this release adds two new options to the
|
||||||
:djadmin:`runserver` command to modify this behaviour:
|
:djadmin:`runserver` command to modify this behavior:
|
||||||
|
|
||||||
* ``--nostatic``: prevents the :djadmin:`runserver` command from serving
|
* ``--nostatic``: prevents the :djadmin:`runserver` command from serving
|
||||||
files completely.
|
files completely.
|
||||||
|
|
|
@ -521,7 +521,7 @@ Callables in templates
|
||||||
Previously, a callable in a template would only be called automatically as part
|
Previously, a callable in a template would only be called automatically as part
|
||||||
of the variable resolution process if it was retrieved via attribute
|
of the variable resolution process if it was retrieved via attribute
|
||||||
lookup. This was an inconsistency that could result in confusing and unhelpful
|
lookup. This was an inconsistency that could result in confusing and unhelpful
|
||||||
behaviour::
|
behavior::
|
||||||
|
|
||||||
>>> Template("{{ user.get_full_name }}").render(Context({'user': user}))
|
>>> Template("{{ user.get_full_name }}").render(Context({'user': user}))
|
||||||
u'Joe Bloggs'
|
u'Joe Bloggs'
|
||||||
|
@ -529,7 +529,7 @@ behaviour::
|
||||||
u'<bound method User.get_full_name of <...
|
u'<bound method User.get_full_name of <...
|
||||||
|
|
||||||
This has been resolved in Django 1.3 - the result in both cases will be ``u'Joe
|
This has been resolved in Django 1.3 - the result in both cases will be ``u'Joe
|
||||||
Bloggs'``. Although the previous behaviour was not useful for a template language
|
Bloggs'``. Although the previous behavior was not useful for a template language
|
||||||
designed for web designers, and was never deliberately supported, it is possible
|
designed for web designers, and was never deliberately supported, it is possible
|
||||||
that some templates may be broken by this change.
|
that some templates may be broken by this change.
|
||||||
|
|
||||||
|
|
|
@ -292,7 +292,7 @@ Manager functions
|
||||||
The :attr:`~django.contrib.auth.models.User.username` and
|
The :attr:`~django.contrib.auth.models.User.username` and
|
||||||
:attr:`~django.contrib.auth.models.User.password` are set as given. The
|
:attr:`~django.contrib.auth.models.User.password` are set as given. The
|
||||||
domain portion of :attr:`~django.contrib.auth.models.User.email` is
|
domain portion of :attr:`~django.contrib.auth.models.User.email` is
|
||||||
automatically convered to lowercase, and the returned
|
automatically converted to lowercase, and the returned
|
||||||
:class:`~django.contrib.auth.models.User` object will have
|
:class:`~django.contrib.auth.models.User` object will have
|
||||||
:attr:`~models.User.is_active` set to ``True``.
|
:attr:`~models.User.is_active` set to ``True``.
|
||||||
|
|
||||||
|
@ -1243,7 +1243,7 @@ To create custom permissions for a given model object, use the ``permissions``
|
||||||
:ref:`model Meta attribute <meta-options>`.
|
:ref:`model Meta attribute <meta-options>`.
|
||||||
|
|
||||||
This example Task model creates three custom permissions, i.e., actions users
|
This example Task model creates three custom permissions, i.e., actions users
|
||||||
can or cannot do with Task instances, specific to your appication::
|
can or cannot do with Task instances, specific to your application::
|
||||||
|
|
||||||
class Task(models.Model):
|
class Task(models.Model):
|
||||||
...
|
...
|
||||||
|
|
|
@ -615,7 +615,7 @@ If :setting:`USE_I18N` is set to ``True`` the per-site middleware cache will
|
||||||
:ref:`respect the active language<i18n-cache-key>`. For the ``cache`` template
|
:ref:`respect the active language<i18n-cache-key>`. For the ``cache`` template
|
||||||
tag you could use one of the
|
tag you could use one of the
|
||||||
:ref:`translation-specific variables<template-translation-vars>` available in
|
:ref:`translation-specific variables<template-translation-vars>` available in
|
||||||
templates to archieve the same result:
|
templates to achieve the same result:
|
||||||
|
|
||||||
.. code-block:: html+django
|
.. code-block:: html+django
|
||||||
|
|
||||||
|
@ -843,7 +843,7 @@ keys unaffected. Continuing our previous example::
|
||||||
# Version 2 isn't available, either
|
# Version 2 isn't available, either
|
||||||
>>> cache.get('my_key', version=2)
|
>>> cache.get('my_key', version=2)
|
||||||
None
|
None
|
||||||
# But version 3 *is* availble
|
# But version 3 *is* available
|
||||||
>>> cache.get('my_key', version=3)
|
>>> cache.get('my_key', version=3)
|
||||||
'hello world!'
|
'hello world!'
|
||||||
|
|
||||||
|
|
|
@ -233,7 +233,7 @@ the first query will provide the total number of all books published by the
|
||||||
publisher; the second query will only include good books in the annotated
|
publisher; the second query will only include good books in the annotated
|
||||||
count. In the first query, the annotation precedes the filter, so the
|
count. In the first query, the annotation precedes the filter, so the
|
||||||
filter has no effect on the annotation. In the second query, the filter
|
filter has no effect on the annotation. In the second query, the filter
|
||||||
preceeds the annotation, and as a result, the filter constrains the objects
|
precedes the annotation, and as a result, the filter constrains the objects
|
||||||
considered when calculating the annotation.
|
considered when calculating the annotation.
|
||||||
|
|
||||||
``order_by()``
|
``order_by()``
|
||||||
|
|
|
@ -188,7 +188,7 @@ ones:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
>>> p = Person(name="Fred Flinstone", gender="M")
|
>>> p = Person(name="Fred Flintstone", gender="M")
|
||||||
>>> p.save()
|
>>> p.save()
|
||||||
>>> p.gender
|
>>> p.gender
|
||||||
u'M'
|
u'M'
|
||||||
|
@ -791,7 +791,7 @@ There are three styles of inheritance that are possible in Django.
|
||||||
2. If you're subclassing an existing model (perhaps something from another
|
2. If you're subclassing an existing model (perhaps something from another
|
||||||
application entirely) and want each model to have its own database table,
|
application entirely) and want each model to have its own database table,
|
||||||
:ref:`multi-table-inheritance` is the way to go.
|
:ref:`multi-table-inheritance` is the way to go.
|
||||||
3. Finally, if you only want to modify the Python-level behaviour of a model,
|
3. Finally, if you only want to modify the Python-level behavior of a model,
|
||||||
without changing the models fields in any way, you can use
|
without changing the models fields in any way, you can use
|
||||||
:ref:`proxy-models`.
|
:ref:`proxy-models`.
|
||||||
|
|
||||||
|
@ -1218,7 +1218,7 @@ cannot create another model field called ``author`` in any class that inherits
|
||||||
from that base class.
|
from that base class.
|
||||||
|
|
||||||
Overriding fields in a parent model leads to difficulties in areas such as
|
Overriding fields in a parent model leads to difficulties in areas such as
|
||||||
initialising new instances (specifying which field is being initialized in
|
initializing new instances (specifying which field is being initialized in
|
||||||
``Model.__init__``) and serialization. These are features which normal Python
|
``Model.__init__``) and serialization. These are features which normal Python
|
||||||
class inheritance doesn't have to deal with in quite the same way, so the
|
class inheritance doesn't have to deal with in quite the same way, so the
|
||||||
difference between Django model inheritance and Python class inheritance isn't
|
difference between Django model inheritance and Python class inheritance isn't
|
||||||
|
|
|
@ -93,13 +93,13 @@ caching.
|
||||||
Use the ``with`` template tag
|
Use the ``with`` template tag
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
To make use of the caching behaviour of ``QuerySet``, you may need to use the
|
To make use of the caching behavior of ``QuerySet``, you may need to use the
|
||||||
:ttag:`with` template tag.
|
:ttag:`with` template tag.
|
||||||
|
|
||||||
Use ``iterator()``
|
Use ``iterator()``
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
When you have a lot of objects, the caching behaviour of the ``QuerySet`` can
|
When you have a lot of objects, the caching behavior of the ``QuerySet`` can
|
||||||
cause a large amount of memory to be used. In this case,
|
cause a large amount of memory to be used. In this case,
|
||||||
:meth:`~django.db.models.QuerySet.iterator()` may help.
|
:meth:`~django.db.models.QuerySet.iterator()` may help.
|
||||||
|
|
||||||
|
@ -252,7 +252,7 @@ individual, use a bulk SQL UPDATE statement, via :ref:`QuerySet.update()
|
||||||
|
|
||||||
Note, however, that these bulk update methods cannot call the ``save()`` or
|
Note, however, that these bulk update methods cannot call the ``save()`` or
|
||||||
``delete()`` methods of individual instances, which means that any custom
|
``delete()`` methods of individual instances, which means that any custom
|
||||||
behaviour you have added for these methods will not be executed, including
|
behavior you have added for these methods will not be executed, including
|
||||||
anything driven from the normal database object :doc:`signals </ref/signals>`.
|
anything driven from the normal database object :doc:`signals </ref/signals>`.
|
||||||
|
|
||||||
Use foreign key values directly
|
Use foreign key values directly
|
||||||
|
|
|
@ -234,7 +234,7 @@ provide the savepoint functions, but they are empty operations - they won't
|
||||||
actually do anything.
|
actually do anything.
|
||||||
|
|
||||||
Savepoints aren't especially useful if you are using the default
|
Savepoints aren't especially useful if you are using the default
|
||||||
``autocommit`` behaviour of Django. However, if you are using
|
``autocommit`` behavior of Django. However, if you are using
|
||||||
``commit_on_success`` or ``commit_manually``, each open transaction will build
|
``commit_on_success`` or ``commit_manually``, each open transaction will build
|
||||||
up a series of database operations, awaiting a commit or rollback. If you
|
up a series of database operations, awaiting a commit or rollback. If you
|
||||||
issue a rollback, the entire transaction is rolled back. Savepoints provide
|
issue a rollback, the entire transaction is rolled back. Savepoints provide
|
||||||
|
|
|
@ -4,7 +4,7 @@ Django shortcut functions
|
||||||
|
|
||||||
.. module:: django.shortcuts
|
.. module:: django.shortcuts
|
||||||
:synopsis:
|
:synopsis:
|
||||||
Convience shortcuts that spam multiple levels of Django's MVC stack.
|
Convenience shortcuts that spam multiple levels of Django's MVC stack.
|
||||||
|
|
||||||
.. index:: shortcuts
|
.. index:: shortcuts
|
||||||
|
|
||||||
|
|
|
@ -156,7 +156,7 @@ and handle logging calls on a per-module basis. However, if you have
|
||||||
some other way of organizing your logging messages, you can provide
|
some other way of organizing your logging messages, you can provide
|
||||||
any dot-separated name to identify your logger::
|
any dot-separated name to identify your logger::
|
||||||
|
|
||||||
# Get an instance of a specfic named logger
|
# Get an instance of a specific named logger
|
||||||
logger = logging.getLogger('project.interesting.stuff')
|
logger = logging.getLogger('project.interesting.stuff')
|
||||||
|
|
||||||
The dotted paths of logger names define a hierarchy. The
|
The dotted paths of logger names define a hierarchy. The
|
||||||
|
|
|
@ -105,7 +105,7 @@ must be able to handle those new arguments.
|
||||||
Connecting receiver functions
|
Connecting receiver functions
|
||||||
-----------------------------
|
-----------------------------
|
||||||
|
|
||||||
There are two ways you can connect a receiever to a signal. You can take the
|
There are two ways you can connect a receiver to a signal. You can take the
|
||||||
manual connect route:
|
manual connect route:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
|
@ -95,7 +95,7 @@ module defines tests in class-based approach.
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
If you want to continue to use the base unittest libary, you can --
|
If you want to continue to use the base unittest library, you can --
|
||||||
you just won't get any of the nice new unittest2 features.
|
you just won't get any of the nice new unittest2 features.
|
||||||
|
|
||||||
.. _unittest2: http://pypi.python.org/pypi/unittest2
|
.. _unittest2: http://pypi.python.org/pypi/unittest2
|
||||||
|
|
Loading…
Reference in New Issue