diff options
| author | Jacob Kaplan-Moss <jacob@jacobian.org> | 2008-09-02 03:40:42 +0000 |
|---|---|---|
| committer | Jacob Kaplan-Moss <jacob@jacobian.org> | 2008-09-02 03:40:42 +0000 |
| commit | 64a94691277db17e87614f125d8da78a9995076b (patch) | |
| tree | 8850007d024ada1901a8965c01e7c6f74ebe0172 /docs/ref | |
| parent | c435975cc779a4549591a1c2b32e91f409c33757 (diff) | |
Fixed #8753: converted "new in ..." callouts to proper Sphinx "versionadded/versionchanged" directives. Thanks to Marc Fargas for all the heavy lifting here.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8843 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/contrib/flatpages.txt | 2 | ||||
| -rw-r--r-- | docs/ref/contrib/formtools/form-wizard.txt | 2 | ||||
| -rw-r--r-- | docs/ref/contrib/humanize.txt | 2 | ||||
| -rw-r--r-- | docs/ref/contrib/index.txt | 4 | ||||
| -rw-r--r-- | docs/ref/contrib/sitemaps.txt | 2 | ||||
| -rw-r--r-- | docs/ref/contrib/sites.txt | 4 | ||||
| -rw-r--r-- | docs/ref/contrib/syndication.txt | 17 | ||||
| -rw-r--r-- | docs/ref/databases.txt | 10 | ||||
| -rw-r--r-- | docs/ref/django-admin.txt | 14 | ||||
| -rw-r--r-- | docs/ref/forms/api.txt | 7 | ||||
| -rw-r--r-- | docs/ref/forms/fields.txt | 29 | ||||
| -rw-r--r-- | docs/ref/forms/widgets.txt | 4 | ||||
| -rw-r--r-- | docs/ref/generic-views.txt | 28 | ||||
| -rw-r--r-- | docs/ref/middleware.txt | 9 | ||||
| -rw-r--r-- | docs/ref/models/fields.txt | 28 | ||||
| -rw-r--r-- | docs/ref/models/instances.txt | 4 | ||||
| -rw-r--r-- | docs/ref/models/options.txt | 4 | ||||
| -rw-r--r-- | docs/ref/models/querysets.txt | 25 | ||||
| -rw-r--r-- | docs/ref/request-response.txt | 29 | ||||
| -rw-r--r-- | docs/ref/settings.txt | 34 | ||||
| -rw-r--r-- | docs/ref/templates/api.txt | 2 | ||||
| -rw-r--r-- | docs/ref/templates/builtins.txt | 46 | ||||
| -rw-r--r-- | docs/ref/unicode.txt | 2 |
23 files changed, 166 insertions, 142 deletions
diff --git a/docs/ref/contrib/flatpages.txt b/docs/ref/contrib/flatpages.txt index 828a4fc0f2..f1c3a1b8f5 100644 --- a/docs/ref/contrib/flatpages.txt +++ b/docs/ref/contrib/flatpages.txt @@ -19,7 +19,7 @@ custom Django application. A flatpage can use a custom template or a default, systemwide flatpage template. It can be associated with one, or multiple, sites. -**New in Django development version** +.. versionadded:: 1.0 The content field may optionally be left blank if you prefer to put your content in a custom template. diff --git a/docs/ref/contrib/formtools/form-wizard.txt b/docs/ref/contrib/formtools/form-wizard.txt index fe8d478d40..3923404f93 100644 --- a/docs/ref/contrib/formtools/form-wizard.txt +++ b/docs/ref/contrib/formtools/form-wizard.txt @@ -7,7 +7,7 @@ Form wizard .. module:: django.contrib.formtools.wizard :synopsis: Splits forms across multiple Web pages. -**New in Django development version.** +.. versionadded:: 1.0 Django comes with an optional "form wizard" application that splits :ref:`forms <topics-forms-index>` across multiple Web pages. It maintains diff --git a/docs/ref/contrib/humanize.txt b/docs/ref/contrib/humanize.txt index 4a544f037c..07a62a7fbe 100644 --- a/docs/ref/contrib/humanize.txt +++ b/docs/ref/contrib/humanize.txt @@ -74,7 +74,7 @@ You can pass in either an integer or a string representation of an integer. naturalday ---------- -**New in Django development version** +.. versionadded:: 1.0 For dates that are the current day or within one day, return "today", "tomorrow" or "yesterday", as appropriate. Otherwise, format the date using diff --git a/docs/ref/contrib/index.txt b/docs/ref/contrib/index.txt index 2f3075ba04..82a895523c 100644 --- a/docs/ref/contrib/index.txt +++ b/docs/ref/contrib/index.txt @@ -59,7 +59,9 @@ See :ref:`topics-auth`. comments ======== -**New in Django development version.** +.. versionchanged:: 1.0 + The comments application has been rewriten. See :ref:`ref-contrib-comments-upgrade` + for information on howto upgrade. A simple yet flexible comments system. See :ref:`ref-contrib-comments-index`. diff --git a/docs/ref/contrib/sitemaps.txt b/docs/ref/contrib/sitemaps.txt index f8328f2f27..b3f682b687 100644 --- a/docs/ref/contrib/sitemaps.txt +++ b/docs/ref/contrib/sitemaps.txt @@ -342,7 +342,7 @@ each time you call ``save()``. Pinging Google via `manage.py` ------------------------------ -**New in Django development version** +.. versionadded:: 1.0 Once the sitemaps application is added to your project, you may also ping the Google server's through the command line manage.py interface:: diff --git a/docs/ref/contrib/sites.txt b/docs/ref/contrib/sites.txt index 5a29370561..28c8f4d73a 100644 --- a/docs/ref/contrib/sites.txt +++ b/docs/ref/contrib/sites.txt @@ -230,7 +230,7 @@ To do this, you can use the sites framework. A simple example:: Caching the current ``Site`` object =================================== -**New in Django development version** +.. versionadded:: 1.0 As the current site is stored in the database, each call to ``Site.objects.get_current()`` could result in a database query. But Django is a @@ -379,7 +379,7 @@ Here's how Django uses the sites framework: .. _requestsite-objects: -**New in Django development version** +.. versionadded:: 1.0 Some :ref:`django.contrib <ref-contrib-index>` applications take advantage of the sites framework but are architected in a way that doesn't *require* the diff --git a/docs/ref/contrib/syndication.txt b/docs/ref/contrib/syndication.txt index 9a2e2c02fe..a2ee621cad 100644 --- a/docs/ref/contrib/syndication.txt +++ b/docs/ref/contrib/syndication.txt @@ -265,10 +265,13 @@ request to the URL :file:`/rss/beats/0613/`: :exc:`ObjectDoesNotExist` in :meth:`get_object()` tells Django to produce a 404 error for that request. - **New in Django development version:** The :meth:`get_object()` method - also has a chance to handle the :file:`/rss/beats/` url. In this case, - :data:`bits` will be an empty list. In our example, ``len(bits) != 1`` and - an :exc:`ObjectDoesNotExist` exception will be raised, so + .. versionadded:: 1.0 + meth:`get_object()` can handle the :file:`/rss/beats/` url. + + The :meth:`get_object()` method also has a chance to handle the + :file:`/rss/beats/` url. In this case, :data:`bits` will be an + empty list. In our example, ``len(bits) != 1`` and an + :exc:`ObjectDoesNotExist` exception will be raised, so :file:`/rss/beats/` will generate a 404 page. But you can handle this case however you like. For example, you could generate a combined feed for all beats. @@ -476,8 +479,6 @@ This example illustrates all possible attributes and methods for a # for them in this order. This property is only used for Atom feeds # (where it is the feed-level ID element). If not provided, the feed # link is used as the ID. - # - # (New in Django development version) def feed_guid(self, obj): """ @@ -652,8 +653,6 @@ This example illustrates all possible attributes and methods for a # ITEM_GUID -- The following method is optional. This property is # only used for Atom feeds (it is the ID element for an item in an # Atom feed). If not provided, the item's link is used by default. - # - # (New in Django development version) def item_guid(self, obj): """ @@ -989,4 +988,4 @@ For example, you might start implementing an iTunes RSS feed generator like so:: Obviously there's a lot more work to be done for a complete custom feed class, but the above example should demonstrate the basic idea. -.. _XMLGenerator: http://docs.python.org/dev/library/xml.sax.utils.html#xml.sax.saxutils.XMLGenerator
\ No newline at end of file +.. _XMLGenerator: http://docs.python.org/dev/library/xml.sax.utils.html#xml.sax.saxutils.XMLGenerator diff --git a/docs/ref/databases.txt b/docs/ref/databases.txt index 5e1f236de8..66bb836ccc 100644 --- a/docs/ref/databases.txt +++ b/docs/ref/databases.txt @@ -315,10 +315,12 @@ many-to-many table would be stored in the ``indexes`` tablespace. The ``data`` field would also generate an index, but no tablespace for it is specified, so it would be stored in the model tablespace ``tables`` by default. -**New in the Django development version:** Use the :setting:`DEFAULT_TABLESPACE` -and :setting:`DEFAULT_INDEX_TABLESPACE` settings to specify default values for -the db_tablespace options. These are useful for setting a tablespace for the -built-in Django apps and other applications whose code you cannot control. +.. versionadded:: 1.0 + +Use the :setting:`DEFAULT_TABLESPACE` and :setting:`DEFAULT_INDEX_TABLESPACE` +settings to specify default values for the db_tablespace options. +These are useful for setting a tablespace for the built-in Django apps and +other applications whose code you cannot control. Django does not create the tablespaces for you. Please refer to `Oracle's documentation`_ for details on creating and managing tablespaces. diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt index 26f136b2f7..d53b0d8a55 100644 --- a/docs/ref/django-admin.txt +++ b/docs/ref/django-admin.txt @@ -98,7 +98,7 @@ Available subcommands cleanup ------- -**New in Django development version** +.. versionadded:: 1.0 Can be run as a cronjob or directly to clean out old data from the database (only expired sessions at the moment). @@ -106,7 +106,8 @@ Can be run as a cronjob or directly to clean out old data from the database compilemessages --------------- -**New in Django development version** +.. versionchanged:: 1.0 + Before 1.0 this was the "bin/compile-messages.py" command. Compiles .po files created with ``makemessages`` to .mo files for use with the builtin gettext support. See :ref:`topics-i18n`. @@ -134,7 +135,7 @@ createsuperuser .. django-admin:: createsuperuser -**New in Django development version** +.. versionadded:: 1.0 Creates a superuser account (a user who has all permissions). This is useful if you need to create an initial superuser account but did not @@ -209,7 +210,7 @@ objects will be dumped. .. django-admin-option:: --exclude -**New in Django development version** +.. versionadded:: 1.0 Exclude a specific application from the applications whose contents is output. For example, to specifically exclude the `auth` application from @@ -383,7 +384,8 @@ Example usage:: makemessages ------------ -**New in Django development version** +.. versionchanged:: 1.0 + Before 1.0 this was the "bin/make-messages.py" command. Runs over the entire source tree of the current directory and pulls out all strings marked for translation. It creates (or updates) a message file in the @@ -734,7 +736,7 @@ Example usage:: testserver <fixture fixture ...> -------------------------------- -**New in Django development version** +.. versionadded:: 1.0 Runs a Django development server (as in ``runserver``) using data from the given fixture(s). diff --git a/docs/ref/forms/api.txt b/docs/ref/forms/api.txt index f8d8a9940a..72dfcb67c9 100644 --- a/docs/ref/forms/api.txt +++ b/docs/ref/forms/api.txt @@ -157,9 +157,8 @@ object:: >>> f.cleaned_data {'cc_myself': True, 'message': u'Hi there', 'sender': u'foo@example.com', 'subject': u'hello'} -.. note:: - **New in Django development version** The ``cleaned_data`` attribute was - called ``clean_data`` in earlier releases. +.. versionchanged:: 1.0 + The ``cleaned_data`` attribute was called ``clean_data`` in earlier releases. Note that any text-based field -- such as ``CharField`` or ``EmailField`` -- always cleans the input into a Unicode string. We'll cover the encoding @@ -564,7 +563,7 @@ when printed:: Binding uploaded files to a form -------------------------------- -**New in Django development version** +.. versionadded:: 1.0 Dealing with forms that have ``FileField`` and ``ImageField`` fields is a little more complicated than a normal form. diff --git a/docs/ref/forms/fields.txt b/docs/ref/forms/fields.txt index 262538fec7..0656c323ae 100644 --- a/docs/ref/forms/fields.txt +++ b/docs/ref/forms/fields.txt @@ -219,9 +219,10 @@ fields. We've specified ``auto_id=False`` to simplify the output:: ``error_messages`` ~~~~~~~~~~~~~~~~~~ +.. versionadded:: 1.0 + .. attribute:: Field.error_messages -**New in Django development version** The ``error_messages`` argument lets you override the default messages that the field will raise. Pass in a dictionary with keys matching the error messages you @@ -314,9 +315,9 @@ For each field, we describe the default widget used if you don't specify the field has ``required=True``. * Error message keys: ``required`` -**New in Django development version:** The empty value for a ``CheckboxInput`` -(and hence the standard ``BooleanField``) has changed to return ``False`` -instead of ``None`` in the development version. +.. versionchanged:: 1.0 + The empty value for a ``CheckboxInput`` (and hence the standard ``BooleanField``) + has changed to return ``False`` instead of ``None`` in the development version. .. note:: @@ -448,15 +449,15 @@ If no ``input_formats`` argument is provided, the default input formats are:: '%m/%d/%y %H:%M', # '10/25/06 14:30' '%m/%d/%y', # '10/25/06' -**New in Django development version:** The ``DateTimeField`` used to use a -``TextInput`` widget by default. This has now changed. +.. versionchanged:: 1.0 + The ``DateTimeField`` used to use a ``TextInput`` widget by default. This has now changed. ``DecimalField`` ~~~~~~~~~~~~~~~~ -.. class:: DecimalField(**kwargs) +.. versionadded:: 1.0 -**New in Django development version** +.. class:: DecimalField(**kwargs) * Default widget: ``TextInput`` * Empty value: ``None`` @@ -503,9 +504,9 @@ given length. ``FileField`` ~~~~~~~~~~~~~ -.. class:: FileField(**kwargs) +.. versionadded:: 1.0 -**New in Django development version** +.. class:: FileField(**kwargs) * Default widget: ``FileInput`` * Empty value: ``None`` @@ -523,9 +524,9 @@ When you use a ``FileField`` in a form, you must also remember to ``FilePathField`` ~~~~~~~~~~~~~~~~~ -.. class:: FilePathField(**kwargs) +.. versionadded:: 1.0 -**New in Django development version** +.. class:: FilePathField(**kwargs) * Default widget: ``Select`` * Empty value: ``None`` @@ -569,9 +570,9 @@ These control the range of values permitted in the field. ``ImageField`` ~~~~~~~~~~~~~~ -.. class:: ImageField(**kwargs) +.. versionadded:: 1.0 -**New in Django development version** +.. class:: ImageField(**kwargs) * Default widget: ``FileInput`` * Empty value: ``None`` diff --git a/docs/ref/forms/widgets.txt b/docs/ref/forms/widgets.txt index a7d35f4ddd..c9cc292b30 100644 --- a/docs/ref/forms/widgets.txt +++ b/docs/ref/forms/widgets.txt @@ -38,9 +38,9 @@ commonly used groups of widgets: .. class:: DateTimeInput - Date/time input as a simple text box: ``<input type='text' ...>`` + .. versionadded:: 1.0 - **New in Django development version:** + Date/time input as a simple text box: ``<input type='text' ...>`` .. class:: Textarea diff --git a/docs/ref/generic-views.txt b/docs/ref/generic-views.txt index f92a301c2f..2e4c6d2225 100644 --- a/docs/ref/generic-views.txt +++ b/docs/ref/generic-views.txt @@ -198,9 +198,10 @@ a date in the *future* are not included unless you set ``allow_future`` to specified in ``date_field`` is greater than the current date/time. By default, this is ``False``. - * **New in Django development version:** ``template_object_name``: - Designates the name of the template variable to use in the template - context. By default, this is ``'latest'``. + .. versionadded:: 1.0 + + * ``template_object_name``: Designates the name of the template variable + to use in the template context. By default, this is ``'latest'``. **Template name:** @@ -223,14 +224,16 @@ In addition to ``extra_context``, the template's context will be: ordered in reverse. This is equivalent to ``queryset.dates(date_field, 'year')[::-1]``. + .. versionchanged:: 1.0 + The behaviour depending on ``template_object_name`` is new in this version. + * ``latest``: The ``num_latest`` objects in the system, ordered descending by ``date_field``. For example, if ``num_latest`` is ``10``, then ``latest`` will be a list of the latest 10 objects in ``queryset``. - **New in Django development version:** This variable's name depends on - the ``template_object_name`` parameter, which is ``'latest'`` by default. - If ``template_object_name`` is ``'foo'``, this variable's name will be - ``foo``. + This variable's name depends on the ``template_object_name`` parameter, + which is ``'latest'`` by default. If ``template_object_name`` is + ``'foo'``, this variable's name will be ``foo``. ``django.views.generic.date_based.archive_year`` ------------------------------------------------ @@ -733,6 +736,9 @@ If ``template_name`` isn't specified, this view will use the template **Template context:** +.. versionadded:: 1.0 + The ``paginator`` and ``page_obj`` context variables are new. + In addition to ``extra_context``, the template's context will be: * ``object_list``: The list of objects. This variable's name depends on the @@ -746,11 +752,9 @@ In addition to ``extra_context``, the template's context will be: If the results are paginated, the context will contain these extra variables: - * **New in Django development version:** ``paginator``: An instance of - ``django.core.paginator.Paginator``. + * ``paginator``: An instance of ``django.core.paginator.Paginator``. - * **New in Django development version:** ``page_obj``: An instance of - ``django.core.paginator.Page``. + * ``page_obj``: An instance of ``django.core.paginator.Page``. Notes on pagination ~~~~~~~~~~~~~~~~~~~ @@ -778,7 +782,7 @@ represented as page ``1``. For more on pagination, read the :ref:`pagination documentation <topics-pagination>`. -**New in Django development version:** +.. versionadded:: 1.0 As a special case, you are also permitted to use ``last`` as a value for ``page``:: diff --git a/docs/ref/middleware.txt b/docs/ref/middleware.txt index 278f00039e..47b4a70927 100644 --- a/docs/ref/middleware.txt +++ b/docs/ref/middleware.txt @@ -54,9 +54,10 @@ Adds a few conveniences for perfectionists: don't have a valid URL pattern for ``foo.com/bar`` but *do* have a valid pattern for ``foo.com/bar/``. - **New in Django development version:** The behavior of - :setting:`APPEND_SLASH` has changed slightly in the development version. - It didn't used to check whether the pattern was matched in the URLconf. + .. versionchanged:: 1.0 + The behavior of :setting:`APPEND_SLASH` has changed slightly in this + version. It didn't used to check whether the pattern was matched in + the URLconf. If :setting:`PREPEND_WWW` is ``True``, URLs that lack a leading "www." will be redirected to the same URL with a leading "www." @@ -175,7 +176,7 @@ CSRF protection middleware .. class:: django.contrib.csrf.middleware.CsrfMiddleware -**New in Django development version** +.. versionadded:: 1.0 Adds protection against Cross Site Request Forgeries by adding hidden form fields to POST forms and checking requests for the correct value. See the diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt index f48d5226b5..370c0284df 100644 --- a/docs/ref/models/fields.txt +++ b/docs/ref/models/fields.txt @@ -171,7 +171,7 @@ If ``True``, djadmin:`django-admin.py sqlindexes <sqlindexes>` will output a .. attribute:: Field.db_tablespace -**New in Django development version** +.. versionadded:: 1.0 The name of the database tablespace to use for this field's index, if this field is indexed. The default is the project's :setting:`DEFAULT_INDEX_TABLESPACE` @@ -366,7 +366,7 @@ shortcuts. ``DecimalField`` ---------------- -**New in Django development version** +.. versionadded:: 1.0 .. class:: DecimalField(max_digits=None, decimal_places=None, [**options]) @@ -422,7 +422,7 @@ A file-upload field. Has one **required** argument: date/time of the file upload (so that uploaded files don't fill up the given directory). - **New in Django development version** + .. versionadded:: 1.0 This may also be a callable, such as a function, which will be called to obtain the upload path, including the filename. This callable must be @@ -452,7 +452,7 @@ Also has one optional argument: .. attribute:: FileField.storage - **New in Django development version.** + .. versionadded:: 1.0 Optional. A storage object, which handles the storage and retrieval of your files. See :ref:`topics-files` for details on how to provide this object. @@ -499,7 +499,10 @@ without validation, to a directory that's within your Web server's document root, then somebody could upload a CGI or PHP script and execute that script by visiting its URL on your site. Don't allow that. -**New in development version:** By default, :class:`FileField` instances are +.. versionadded:: 1.0 + The ``max_length`` argument was added in this version. + +By default, :class:`FileField` instances are created as ``varchar(100)`` columns in your database. As with other fields, you can change the maximum length using the :attr:`~CharField.max_length` argument. @@ -542,7 +545,10 @@ base filename, not the full path. So, this example:: because the :attr:`~FilePathField.match` applies to the base filename (``foo.gif`` and ``bar.gif``). -**New in development version:** By default, :class:`FilePathField` instances are +.. versionadded:: 1.0 + The ``max_length`` argument was added in this version. + +By default, :class:`FilePathField` instances are created as ``varchar(100)`` columns in your database. As with other fields, you can change the maximum length using the :attr:`~CharField.max_length` argument. @@ -588,7 +594,10 @@ Requires the `Python Imaging Library`_. .. _Python Imaging Library: http://www.pythonware.com/products/pil/ -**New in development version:** By default, :class:`ImageField` instances are +.. versionadded:: 1.0 + The ``max_length`` argument was added in this version. + +By default, :class:`ImageField` instances are created as ``varchar(100)`` columns in your database. As with other fields, you can change the maximum length using the :attr:`~CharField.max_length` argument. @@ -753,7 +762,10 @@ Note, however, that this only refers to models in the same ``models.py`` file -- you cannot use a string to reference a model defined in another application or imported from elsewhere. -**New in Django development version:** To refer to models defined in another +.. versionchanged:: 1.0 + Refering models in other applications must include the application label. + +To refer to models defined in another application, you must instead explicitly specify the application label. For example, if the ``Manufacturer`` model above is defined in another application called ``production``, you'd need to use:: diff --git a/docs/ref/models/instances.txt b/docs/ref/models/instances.txt index c315bec89b..06c78c6f62 100644 --- a/docs/ref/models/instances.txt +++ b/docs/ref/models/instances.txt @@ -62,7 +62,7 @@ documentation for ``AutoField`` for more details. The ``pk`` property ~~~~~~~~~~~~~~~~~~~ -**New in Django development version** +.. versionadded:: 1.0 .. attribute:: Model.pk @@ -172,7 +172,7 @@ auto-primary-key values`_ above and `Forcing an INSERT or UPDATE`_ below. Forcing an INSERT or UPDATE ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -**New in Django development version** +.. versionadded:: 1.0 In some rare circumstances, it's necessary to be able to force the ``save()`` method to perform an SQL ``INSERT`` and not fall back to doing an ``UPDATE``. diff --git a/docs/ref/models/options.txt b/docs/ref/models/options.txt index 745e8ceb4f..e4e2d38543 100644 --- a/docs/ref/models/options.txt +++ b/docs/ref/models/options.txt @@ -55,7 +55,7 @@ Django quotes column and table names behind the scenes. .. attribute:: Options.db_tablespace -**New in Django development version** +.. versionadded:: 1.0 The name of the database tablespace to use for the model. If the backend doesn't support tablespaces, this option is ignored. @@ -152,7 +152,7 @@ It's used in the Django admin and is enforced at the database level (i.e., the appropriate ``UNIQUE`` statements are included in the ``CREATE TABLE`` statement). -**New in Django development version** +.. versionadded:: 1.0 For convenience, unique_together can be a single list when dealing with a single set of fields:: diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt index 3813ec714f..6da621482a 100644 --- a/docs/ref/models/querysets.txt +++ b/docs/ref/models/querysets.txt @@ -376,7 +376,7 @@ Examples:: ``none()`` ~~~~~~~~~~ -**New in Django development version** +.. versionadded:: 1.0 Returns an ``EmptyQuerySet`` -- a ``QuerySet`` that always evaluates to an empty list. This can be used in cases where you know that you should @@ -458,7 +458,8 @@ follow:: p = b.author # Doesn't hit the database. c = p.hometown # Requires a database call. -The ``depth`` argument is new in the Django development version. +.. versionadded:: 1.0 + The ``depth`` argument is new in the Django development version. ``extra(select=None, where=None, params=None, tables=None, order_by=None, select_params=None)`` ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -518,7 +519,8 @@ of the arguments is required, but you should use at least one of them. some database backends, such as some MySQL versions, don't support subqueries. - **New in Django development version** + .. versionadded:: 1.0 + In some rare cases, you might wish to pass parameters to the SQL fragments in ``extra(select=...)```. For this purpose, use the ``select_params`` parameter. Since ``select_params`` is a sequence and the ``select`` @@ -619,10 +621,6 @@ of the arguments is required, but you should use at least one of them. Entry.objects.extra(where=['headline=%s'], params=['Lennon']) -**New in Django development version** The ``select_params`` argument to -``extra()`` is new. Previously, you could attempt to pass parameters for -``select`` in the ``params`` argument, but it worked very unreliably. - QuerySet methods that do not return QuerySets --------------------------------------------- @@ -853,10 +851,11 @@ SQL equivalents:: SELECT ... WHERE id = 14; SELECT ... WHERE id IS NULL; -**New in Django development version:** The semantics of ``id__exact=None`` have -changed in the development version. Previously, it was (intentionally) -converted to ``WHERE id = NULL`` at the SQL level, which would never match -anything. It has now been changed to behave the same as ``id__isnull=True``. +.. versionchanged:: 1.0 + The semantics of ``id__exact=None`` have + changed in the development version. Previously, it was (intentionally) + converted to ``WHERE id = NULL`` at the SQL level, which would never match + anything. It has now been changed to behave the same as ``id__isnull=True``. .. admonition:: MySQL comparisons @@ -1140,7 +1139,7 @@ database to add the full-text index. regex ~~~~~ -**New in Django development version** +.. versionadded:: 1.0 Case-sensitive regular expression match. @@ -1168,7 +1167,7 @@ regular expression syntax is recommended. iregex ~~~~~~ -**New in Django development version** +.. versionadded:: 1.0 Case-insensitive regular expression match. diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt index 6415a7d335..486ede0a78 100644 --- a/docs/ref/request-response.txt +++ b/docs/ref/request-response.txt @@ -49,7 +49,7 @@ All attributes except ``session`` should be considered read-only. .. attribute:: HttpRequest.encoding - **New in Django development version** + .. versionadded:: 1.0 A string representing the current encoding used to decode form submission data (or ``None``, which means the ``DEFAULT_CHARSET`` setting is used). @@ -183,7 +183,7 @@ Methods .. method:: HttpRequest.get_host() - **New in Django development version** + .. versionadded:: 1.0 Returns the originating host of the request using information from the ``HTTP_X_FORWARDED_HOST`` and ``HTTP_HOST`` headers (in that order). If @@ -202,7 +202,7 @@ Methods .. method:: HttpRequest.build_absolute_uri(location) - **New in Django development version** + .. versionadded:: 1.0 Returns the absolute URI form of ``location``. If no location is provided, the location will be set to ``request.get_full_path()``. @@ -220,7 +220,7 @@ Methods .. method:: HttpRequest.is_ajax() - **New in Django development version** + .. versionadded:: 1.0 Returns ``True`` if the request was made via an ``XMLHttpRequest``, by checking the ``HTTP_X_REQUESTED_WITH`` header for the string ``'XMLHttpRequest'``. The @@ -448,13 +448,15 @@ Methods ``status`` is the `HTTP Status code`_ for the response. - **(New in Django development version)** ``content_type`` is an alias for - ``mimetype``. Historically, the parameter was only called ``mimetype``, - but since this is actually the value included in the HTTP ``Content-Type`` - header, it can also include the character set encoding, which makes it - more than just a MIME type specification. If ``mimetype`` is specified - (not ``None``), that value is used. Otherwise, ``content_type`` is used. If - neither is given, the ``DEFAULT_CONTENT_TYPE`` setting is used. + .. versionadded:: 1.0 + + ``content_type`` is an alias for ``mimetype``. Historically, this parameter + was only called ``mimetype``, but since this is actually the value included + in the HTTP ``Content-Type`` header, it can also include the character set + encoding, which makes it more than just a MIME type specification. + If ``mimetype`` is specified (not ``None``), that value is used. + Otherwise, ``content_type`` is used. If neither is given, the + ``DEFAULT_CONTENT_TYPE`` setting is used. .. method:: HttpResponse.__setitem__(header, value) @@ -548,8 +550,9 @@ types of HTTP responses. Like ``HttpResponse``, these subclasses live in .. class:: HttpResponseBadRequest - **New in Django development version.** Acts just like :class:`HttpResponse` - but uses a 400 status code. + .. versionadded:: 1.0 + + Acts just like :class:`HttpResponse` but uses a 400 status code. .. class:: HttpResponseNotFound diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index 6273a3676f..ec62575e71 100644 --- a/docs/ref/settings.txt +++ b/docs/ref/settings.txt @@ -287,7 +287,7 @@ Never deploy a site into production with ``DEBUG`` turned on. DEBUG_PROPAGATE_EXCEPTIONS -------------------------- -**New in Django development version** +.. versionadded:: 1.0 Default: ``False`` @@ -342,7 +342,7 @@ site manager(s). DEFAULT_TABLESPACE ------------------ -**New in Django development version** +.. versionadded:: 1.0 Default: ``''`` (Empty string) @@ -354,7 +354,7 @@ backend supports it. DEFAULT_INDEX_TABLESPACE ------------------------ -**New in Django development version** +.. versionadded:: 1.0 Default: ``''`` (Empty string) @@ -435,7 +435,7 @@ trailing space. EMAIL_USE_TLS ------------- -**New in Django development version** +.. versionadded:: 1.0 Default: ``False`` @@ -446,7 +446,7 @@ Whether to use a TLS (secure) connection when talking to the SMTP server. FILE_CHARSET ------------ -**New in Django development version** +.. versionadded:: 1.0 Default: ``'utf-8'`` @@ -458,7 +458,7 @@ template files and initial SQL data files. FILE_UPLOAD_HANDLERS -------------------- -**New in Django development version** +.. versionadded:: 1.0 Default:: @@ -472,7 +472,7 @@ A tuple of handlers to use for uploading. See :ref:`topics-files` for details. FILE_UPLOAD_MAX_MEMORY_SIZE --------------------------- -**New in Django development version** +.. versionadded:: 1.0 Default: ``2621440`` (i.e. 2.5 MB). @@ -484,7 +484,7 @@ the file system. See :ref:`topics-files` for details. FILE_UPLOAD_TEMP_DIR -------------------- -**New in Django development version** +.. versionadded:: 1.0 Default: ``None`` @@ -615,7 +615,7 @@ standard language format. For example, U.S. English is ``"en-us"``. See LANGUAGE_COOKIE_NAME -------------------- -**New in Django development version** +.. versionadded:: 1.0 Default: ``'django_language'`` @@ -679,7 +679,7 @@ See :ref:`translations-in-your-own-projects`. LOGIN_REDIRECT_URL ------------------ -**New in Django development version** +.. versionadded:: 1.0 Default: ``'/accounts/profile/'`` @@ -694,7 +694,7 @@ decorator, for example. LOGIN_URL --------- -**New in Django development version** +.. versionadded:: 1.0 Default: ``'/accounts/login/'`` @@ -706,7 +706,7 @@ The URL where requests are redirected for login, specially when using the LOGOUT_URL ---------- -**New in Django development version** +.. versionadded:: 1.0 Default: ``'/accounts/logout/'`` @@ -866,7 +866,7 @@ The e-mail address that error messages come from, such as those sent to SESSION_ENGINE -------------- -**New in Django development version** +.. versionadded:: 1.0 Default: ``django.contrib.sessions.backends.db`` @@ -913,7 +913,7 @@ should be different from ``LANGUAGE_COOKIE_NAME``). See the :ref:`topics-http-se SESSION_COOKIE_PATH ------------------- -**New in Django development version** +.. versionadded:: 1.0 Default: ``'/'`` @@ -951,7 +951,7 @@ See the :ref:`topics-http-sessions`. SESSION_FILE_PATH ----------------- -**New in Django development version** +.. versionadded:: 1.0 Default: ``None`` @@ -1058,7 +1058,7 @@ misspelled) variables. See :ref:`invalid-template-variables`.. TEST_DATABASE_CHARSET --------------------- -**New in Django development version** +.. versionadded:: 1.0 Default: ``None`` @@ -1076,7 +1076,7 @@ Supported for the PostgreSQL_ (``postgresql``, ``postgresql_psycopg2``) and MySQ TEST_DATABASE_COLLATION ------------------------ -**New in Django development version** +.. versionadded:: 1.0 Default: ``None`` diff --git a/docs/ref/templates/api.txt b/docs/ref/templates/api.txt index c78f130972..80614ae35c 100644 --- a/docs/ref/templates/api.txt +++ b/docs/ref/templates/api.txt @@ -387,7 +387,7 @@ See :ref:`topics-i18n` for more. django.core.context_processors.media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -**New in Django development version** +.. versionadded:: 1.0 If :setting:`TEMPLATE_CONTEXT_PROCESSORS` contains this processor, every ``RequestContext`` will contain a variable ``MEDIA_URL``, providing the diff --git a/docs/ref/templates/builtins.txt b/docs/ref/templates/builtins.txt index 2e143a3967..669b97d1e8 100644 --- a/docs/ref/templates/builtins.txt +++ b/docs/ref/templates/builtins.txt @@ -19,7 +19,7 @@ Built-in tag reference autoescape ~~~~~~~~~~ -**New in Django development version** +.. versionadded:: 1.0 Control the current auto-escaping behavior. This tag takes either ``on`` or ``off`` as an argument and that determines whether auto-escaping is in effect @@ -54,8 +54,8 @@ Ignore everything between ``{% comment %}`` and ``{% endcomment %}`` cycle ~~~~~ -**Changed in Django development version** -Cycle among the given strings or variables each time this tag is encountered. +.. versionchanged:: 1.0 + Cycle among the given strings or variables each time this tag is encountered. Within a loop, cycles among the given strings/variables each time through the loop:: @@ -171,7 +171,8 @@ provided in ``athlete_list``:: You can loop over a list in reverse by using ``{% for obj in list reversed %}``. -**New in Django development version** +.. versionadded:: 1.0 + If you need to loop over a list of lists, you can unpack the values in each sub-list into individual variables. For example, if your context contains a list of (x,y) coordinates called ``points``, you could use the @@ -671,9 +672,11 @@ such as this:: The template tag will output the string ``/clients/client/123/``. -**New in development version:** If you're using :ref:`named URL patterns -<naming-url-patterns>`, you can refer to the name of the pattern in the ``url`` -tag instead of using the path to the view. +.. versionadded:: 1.0 + +If you're using :ref:`named URL patterns <naming-url-patterns>`, you can +refer to the name of the pattern in the ``url`` tag instead of using the +path to the view. Note that if the URL you're reversing doesn't exist, you'll get an :exc:`NoReverseMatch` exception raised, which will cause your site to display an @@ -719,7 +722,7 @@ which is rounded up to 88). with ~~~~ -**New in Django development version** +.. versionadded:: 1.0 Caches a complex variable under a simpler name. This is useful when accessing an "expensive" method (e.g., one that hits the database) multiple times. @@ -758,9 +761,6 @@ addslashes Adds slashes before quotes. Useful for escaping strings in CSV, for example. -**New in Django development version**: For escaping data in JavaScript strings, -use the `escapejs`_ filter instead. - .. templatefilter:: capfirst capfirst @@ -906,16 +906,17 @@ applied to the result will only result in one round of escaping being done. So it is safe to use this function even in auto-escaping environments. If you want multiple escaping passes to be applied, use the ``force_escape`` filter. -**New in Django development version:** Due to auto-escaping, the behavior of -this filter has changed slightly. The replacements are only made once, after -all other filters are applied -- including filters before and after it. +.. versionchanged:: 1.0 + Due to auto-escaping, the behavior of this filter has changed slightly. + The replacements are only made once, after + all other filters are applied -- including filters before and after it. .. templatefilter:: escapejs escapejs ~~~~~~~~ -**New in Django development version** +.. versionadded:: 1.0 Escapes characters for use in JavaScript strings. This does *not* make the string safe for use in HTML, but does protect you from syntax errors when using @@ -953,6 +954,9 @@ If ``value`` is the list ``['a', 'b', 'c']``, the output will be ``'a'``. fix_ampersands ~~~~~~~~~~~~~~ +.. versionchanged:: 1.0 + This is rarely useful as ampersands are now automatically escaped. See escape_ for more information. + Replaces ampersands with ``&`` entities. For example:: @@ -961,10 +965,6 @@ For example:: If ``value`` is ``Tom & Jerry``, the output will be ``Tom & Jerry``. -**New in Django development version**: This filter generally is no longer -useful, because ampersands are automatically escaped in templates. See escape_ -for more on how auto-escaping works. - .. templatefilter:: floatformat floatformat @@ -1012,7 +1012,7 @@ with an argument of ``-1``. force_escape ~~~~~~~~~~~~ -**New in Django development version** +.. versionadded:: 1.0 Applies HTML escaping to a string (see the ``escape`` filter for details). This filter is applied *immediately* and returns a new, escaped string. This @@ -1067,7 +1067,7 @@ If ``value`` is the list ``['a', 'b', 'c']``, the output will be the string last ~~~~ -**New in Django development version.** +.. versionadded:: 1.0 Returns the last item in a list. @@ -1419,8 +1419,8 @@ unordered_list Recursively takes a self-nested list and returns an HTML unordered list -- WITHOUT opening and closing <ul> tags. -**New in Django development version:** The format accepted by -``unordered_list`` has changed to be easier to understand. +.. versionchanged:: 1.0 + The format accepted by ``unordered_list`` has changed to be easier to understand. The list is assumed to be in the proper format. For example, if ``var`` contains ``['States', ['Kansas', ['Lawrence', 'Topeka'], 'Illinois']]``, then diff --git a/docs/ref/unicode.txt b/docs/ref/unicode.txt index 985ab15096..4976a35af9 100644 --- a/docs/ref/unicode.txt +++ b/docs/ref/unicode.txt @@ -4,7 +4,7 @@ Unicode data in Django ====================== -**New in Django development version** +.. versionadded:: 1.0 Django natively supports Unicode data everywhere. Providing your database can somehow store the data, you can safely pass around Unicode strings to |
