Edited some docs changes from the past few days

git-svn-id: http://code.djangoproject.com/svn/django/trunk@7361 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2008-03-25 04:42:21 +00:00
parent 23912ebbe2
commit 0e552e5cd6
8 changed files with 25 additions and 26 deletions

View File

@ -287,7 +287,7 @@ SESSION_COOKIE_PATH = '/' # The path of the sessio
SESSION_SAVE_EVERY_REQUEST = False # Whether to save the session data on every request. SESSION_SAVE_EVERY_REQUEST = False # Whether to save the session data on every request.
SESSION_EXPIRE_AT_BROWSER_CLOSE = False # Whether sessions expire when a user closes his browser. SESSION_EXPIRE_AT_BROWSER_CLOSE = False # Whether sessions expire when a user closes his browser.
SESSION_ENGINE = 'django.contrib.sessions.backends.db' # The module to store session data SESSION_ENGINE = 'django.contrib.sessions.backends.db' # The module to store session data
SESSION_FILE_PATH = None # Directory to store session files if using the file session module. If set to None the backend will use a sensible default. SESSION_FILE_PATH = None # Directory to store session files if using the file session module. If None, the backend will use a sensible default.
######### #########
# CACHE # # CACHE #

View File

@ -825,14 +825,14 @@ The interpolation syntax is borrowed from Python, so the ``interpolate``
function supports both positional and named interpolation: function supports both positional and named interpolation:
* Positional interpolation: ``obj`` contains a JavaScript Array object * Positional interpolation: ``obj`` contains a JavaScript Array object
whose elements values are then sequentially interpolated in their whose elements values are then sequentially interpolated in their
corresponding ``fmt`` placeholders in the same order they appear. corresponding ``fmt`` placeholders in the same order they appear.
For example:: For example::
fmts = ngettext('There is %s object. Remaining: %s', fmts = ngettext('There is %s object. Remaining: %s',
'There are %s objects. Remaining: %s', 11); 'There are %s objects. Remaining: %s', 11);
s = interpolate(fmts, [11, 20]); s = interpolate(fmts, [11, 20]);
// s is 'There are 11 objects. Remaining: 20' // s is 'There are 11 objects. Remaining: 20'
* Named interpolation: This mode is selected by passing the optional * Named interpolation: This mode is selected by passing the optional
boolean ``named`` parameter as true. ``obj`` contains a JavaScript boolean ``named`` parameter as true. ``obj`` contains a JavaScript
@ -844,7 +844,7 @@ function supports both positional and named interpolation:
}; };
fmts = ngettext('Total: %(total)s, there is %(count)s object', fmts = ngettext('Total: %(total)s, there is %(count)s object',
'there are %(count)s of a total of %(total)s objects', d.count); 'there are %(count)s of a total of %(total)s objects', d.count);
s = interpolate(fmts, d, true); s = interpolate(fmts, d, true);
You shouldn't go over the top with string interpolation, though: this is still You shouldn't go over the top with string interpolation, though: this is still

View File

@ -172,11 +172,11 @@ Installing the development version
If you decide to use the latest development version of Django, If you decide to use the latest development version of Django,
you'll want to pay close attention to `the development timeline`_, you'll want to pay close attention to `the development timeline`_,
and you'll want to keep an eye on `the list of and you'll want to keep an eye on `the list of
backwards-incompatible changes`_; this will help you stay on top backwards-incompatible changes`_. This will help you stay on top
of any new features you might want to use, as well as any changes of any new features you might want to use, as well as any changes
you'll need to make to your code when updating your copy of Django you'll need to make to your code when updating your copy of Django.
(for stable releases, any necessary changes are documented in the (For stable releases, any necessary changes are documented in the
release notes). release notes.)
.. _the development timeline: http://code.djangoproject.com/timeline .. _the development timeline: http://code.djangoproject.com/timeline
.. _the list of backwards-incompatible changes: http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges .. _the list of backwards-incompatible changes: http://code.djangoproject.com/wiki/BackwardsIncompatibleChanges

View File

@ -236,7 +236,7 @@ works exactly the same way as any other ``newforms`` form. For
example, the ``is_valid()`` method is used to check for validity, the example, the ``is_valid()`` method is used to check for validity, the
``is_multipart()`` method is used to determine whether a form requires ``is_multipart()`` method is used to determine whether a form requires
multipart file upload (and hence whether ``request.FILES`` must be multipart file upload (and hence whether ``request.FILES`` must be
passed to the form), etc.; see `the standard newforms documentation`_ passed to the form), etc. See `the standard newforms documentation`_
for more information. for more information.
.. _the standard newforms documentation: ../newforms/ .. _the standard newforms documentation: ../newforms/

View File

@ -143,14 +143,13 @@ All attributes except ``session`` should be considered read-only.
``urlconf`` ``urlconf``
Not defined by Django itself, but will be read if other code Not defined by Django itself, but will be read if other code
(e.g., a custom middleware class) sets it; when present, this will (e.g., a custom middleware class) sets it. When present, this will
be used as the root URLConf for the current request, overriding be used as the root URLconf for the current request, overriding
the ``ROOT_URLCONF`` setting. See `How Django processes a the ``ROOT_URLCONF`` setting. See `How Django processes a
request`_ for details. request`_ for details.
.. _How Django processes a request: ../url_dispatch/#how-django-processes-a-request .. _How Django processes a request: ../url_dispatch/#how-django-processes-a-request
Methods Methods
------- -------
@ -202,19 +201,19 @@ Methods
``is_ajax()`` ``is_ajax()``
**New in Django development version** **New in Django development version**
Returns ``True`` if the request was made via an XMLHttpRequest by checking Returns ``True`` if the request was made via an ``XMLHttpRequest``, by checking
the ``HTTP_X_REQUESTED_WITH`` header for the string *'XMLHttpRequest'*. The the ``HTTP_X_REQUESTED_WITH`` header for the string ``'XMLHttpRequest'``. The
following major Javascript libraries all send this header: following major JavaScript libraries all send this header:
* jQuery * jQuery
* Dojo * Dojo
* MochiKit * MochiKit
* MooTools * MooTools
* Prototype * Prototype
* YUI * YUI
If you write your own XMLHttpRequest call (on the browser side), you will If you write your own XMLHttpRequest call (on the browser side), you'll
have to set this header manually to use this method. have to set this header manually if you want ``is_ajax()`` to work.
QueryDict objects QueryDict objects
----------------- -----------------

View File

@ -250,7 +250,7 @@ request to the URL ``/rss/beats/0613/``:
will be an empty list. In our example, ``len(bits) != 1`` and an will be an empty list. In our example, ``len(bits) != 1`` and an
``ObjectDoesNotExist`` exception will be raised, so ``/rss/beats/`` will ``ObjectDoesNotExist`` exception will be raised, so ``/rss/beats/`` will
generate a 404 page. But you can handle this case however you like. For generate a 404 page. But you can handle this case however you like. For
example you could generate a combined feed for all beats. example, you could generate a combined feed for all beats.
* To generate the feed's ``<title>``, ``<link>`` and ``<description>``, * To generate the feed's ``<title>``, ``<link>`` and ``<description>``,
Django uses the ``title()``, ``link()`` and ``description()`` methods. In Django uses the ``title()``, ``link()`` and ``description()`` methods. In

View File

@ -39,7 +39,7 @@ A quick rundown:
Django; it's just good Web development practice. Django; it's just good Web development practice.
* ``forloop.counter`` indicates how many times the ``for`` tag has * ``forloop.counter`` indicates how many times the ``for`` tag has
gone through its loop; for more information, see `the gone through its loop. For more information, see `the
documentation for the "for" tag`_. documentation for the "for" tag`_.
.. _the documentation for the "for" tag: ../templates/#for .. _the documentation for the "for" tag: ../templates/#for

View File

@ -32,7 +32,7 @@ How Django processes a request
When a user requests a page from your Django-powered site, this is the When a user requests a page from your Django-powered site, this is the
algorithm the system follows to determine which Python code to execute: algorithm the system follows to determine which Python code to execute:
1. Django determines the root URLConf module to use; ordinarily 1. Django determines the root URLconf module to use. Ordinarily,
this is the value of the ``ROOT_URLCONF`` setting in your this is the value of the ``ROOT_URLCONF`` setting in your
`settings file`_, but if the incoming ``HttpRequest`` object `settings file`_, but if the incoming ``HttpRequest`` object
has an attribute called ``urlconf``, its value will be used in has an attribute called ``urlconf``, its value will be used in