summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
authorAndrew Godwin <andrew@aeracode.org>2013-06-28 17:32:57 +0100
committerAndrew Godwin <andrew@aeracode.org>2013-06-28 17:32:57 +0100
commit7a47ba6f6aeca36b8b092dbafd36abb342d34d4b (patch)
treee959922f7d4d08057225459e31697f410e26df26 /docs/ref
parente2d7e83256234251a81ad3388428f6579795a672 (diff)
parent48dd1e63bbb93479666208535a56f8c7c4aeab3a (diff)
Merge remote-tracking branch 'core/master' into schema-alteration
Conflicts: django/db/backends/__init__.py django/db/models/fields/related.py tests/field_deconstruction/tests.py
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/class-based-views/flattened-index.txt5
-rw-r--r--docs/ref/class-based-views/mixins-editing.txt13
-rw-r--r--docs/ref/contrib/admin/index.txt7
-rw-r--r--docs/ref/contrib/sitemaps.txt2
-rw-r--r--docs/ref/databases.txt8
-rw-r--r--docs/ref/models/fields.txt22
-rw-r--r--docs/ref/models/instances.txt7
-rw-r--r--docs/ref/settings.txt14
-rw-r--r--docs/ref/signals.txt8
-rw-r--r--docs/ref/utils.txt14
10 files changed, 89 insertions, 11 deletions
diff --git a/docs/ref/class-based-views/flattened-index.txt b/docs/ref/class-based-views/flattened-index.txt
index df00f87aa0..272c852181 100644
--- a/docs/ref/class-based-views/flattened-index.txt
+++ b/docs/ref/class-based-views/flattened-index.txt
@@ -151,6 +151,7 @@ FormView
* :attr:`~django.views.generic.edit.FormMixin.form_class` [:meth:`~django.views.generic.edit.FormMixin.get_form_class`]
* :attr:`~django.views.generic.base.View.http_method_names`
* :attr:`~django.views.generic.edit.FormMixin.initial` [:meth:`~django.views.generic.edit.FormMixin.get_initial`]
+* :attr:`~django.views.generic.edit.FormMixin.prefix` [:meth:`~django.views.generic.edit.FormMixin.get_prefix`]
* :attr:`~django.views.generic.base.TemplateResponseMixin.response_class` [:meth:`~django.views.generic.base.TemplateResponseMixin.render_to_response`]
* :attr:`~django.views.generic.edit.FormMixin.success_url` [:meth:`~django.views.generic.edit.FormMixin.get_success_url`]
* :attr:`~django.views.generic.base.TemplateResponseMixin.template_name` [:meth:`~django.views.generic.base.TemplateResponseMixin.get_template_names`]
@@ -177,11 +178,13 @@ CreateView
* :attr:`~django.views.generic.base.TemplateResponseMixin.content_type`
* :attr:`~django.views.generic.detail.SingleObjectMixin.context_object_name` [:meth:`~django.views.generic.detail.SingleObjectMixin.get_context_object_name`]
+* :attr:`~django.views.generic.edit.ModelFormMixin.fields`
* :attr:`~django.views.generic.edit.FormMixin.form_class` [:meth:`~django.views.generic.edit.FormMixin.get_form_class`]
* :attr:`~django.views.generic.base.View.http_method_names`
* :attr:`~django.views.generic.edit.FormMixin.initial` [:meth:`~django.views.generic.edit.FormMixin.get_initial`]
* :attr:`~django.views.generic.detail.SingleObjectMixin.model`
* :attr:`~django.views.generic.detail.SingleObjectMixin.pk_url_kwarg`
+* :attr:`~django.views.generic.edit.FormMixin.prefix` [:meth:`~django.views.generic.edit.FormMixin.get_prefix`]
* :attr:`~django.views.generic.detail.SingleObjectMixin.queryset` [:meth:`~django.views.generic.detail.SingleObjectMixin.get_queryset`]
* :attr:`~django.views.generic.base.TemplateResponseMixin.response_class` [:meth:`~django.views.generic.base.TemplateResponseMixin.render_to_response`]
* :attr:`~django.views.generic.detail.SingleObjectMixin.slug_field` [:meth:`~django.views.generic.detail.SingleObjectMixin.get_slug_field`]
@@ -216,11 +219,13 @@ UpdateView
* :attr:`~django.views.generic.base.TemplateResponseMixin.content_type`
* :attr:`~django.views.generic.detail.SingleObjectMixin.context_object_name` [:meth:`~django.views.generic.detail.SingleObjectMixin.get_context_object_name`]
+* :attr:`~django.views.generic.edit.ModelFormMixin.fields`
* :attr:`~django.views.generic.edit.FormMixin.form_class` [:meth:`~django.views.generic.edit.FormMixin.get_form_class`]
* :attr:`~django.views.generic.base.View.http_method_names`
* :attr:`~django.views.generic.edit.FormMixin.initial` [:meth:`~django.views.generic.edit.FormMixin.get_initial`]
* :attr:`~django.views.generic.detail.SingleObjectMixin.model`
* :attr:`~django.views.generic.detail.SingleObjectMixin.pk_url_kwarg`
+* :attr:`~django.views.generic.edit.FormMixin.prefix` [:meth:`~django.views.generic.edit.FormMixin.get_prefix`]
* :attr:`~django.views.generic.detail.SingleObjectMixin.queryset` [:meth:`~django.views.generic.detail.SingleObjectMixin.get_queryset`]
* :attr:`~django.views.generic.base.TemplateResponseMixin.response_class` [:meth:`~django.views.generic.base.TemplateResponseMixin.render_to_response`]
* :attr:`~django.views.generic.detail.SingleObjectMixin.slug_field` [:meth:`~django.views.generic.detail.SingleObjectMixin.get_slug_field`]
diff --git a/docs/ref/class-based-views/mixins-editing.txt b/docs/ref/class-based-views/mixins-editing.txt
index 48d363b3b2..bf1c10df13 100644
--- a/docs/ref/class-based-views/mixins-editing.txt
+++ b/docs/ref/class-based-views/mixins-editing.txt
@@ -35,6 +35,12 @@ FormMixin
The URL to redirect to when the form is successfully processed.
+ .. attribute:: prefix
+
+ .. versionadded:: 1.6
+
+ The :attr:`~django.forms.Form.prefix` for the generated form.
+
.. method:: get_initial()
Retrieve initial data for the form. By default, returns a copy of
@@ -58,6 +64,13 @@ FormMixin
request is a ``POST`` or ``PUT``, the request data (``request.POST``
and ``request.FILES``) will also be provided.
+ .. method:: get_prefix()
+
+ .. versionadded:: 1.6
+
+ Determine the :attr:`~django.forms.Form.prefix` for the generated form.
+ Returns :attr:`~django.views.generic.edit.FormMixin.prefix` by default.
+
.. method:: get_success_url()
Determine the URL to redirect to when the form is successfully
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt
index 90ef68837a..318ce297a2 100644
--- a/docs/ref/contrib/admin/index.txt
+++ b/docs/ref/contrib/admin/index.txt
@@ -2278,9 +2278,14 @@ your URLconf. Specifically, add these four patterns:
url(r'^admin/password_reset/$', 'django.contrib.auth.views.password_reset', name='admin_password_reset'),
url(r'^admin/password_reset/done/$', 'django.contrib.auth.views.password_reset_done', name='password_reset_done'),
- url(r'^reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$', 'django.contrib.auth.views.password_reset_confirm', name='password_reset_confirm'),
+ url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>.+)/$', 'django.contrib.auth.views.password_reset_confirm', name='password_reset_confirm'),
url(r'^reset/done/$', 'django.contrib.auth.views.password_reset_complete', name='password_reset_complete'),
+.. versionchanged:: 1.6
+
+ The pattern for :func:`~django.contrib.auth.views.password_reset_confirm`
+ changed as the ``uid`` is now base 64 encoded.
+
(This assumes you've added the admin at ``admin/`` and requires that you put
the URLs starting with ``^admin/`` before the line that includes the admin app
itself).
diff --git a/docs/ref/contrib/sitemaps.txt b/docs/ref/contrib/sitemaps.txt
index 56a15cb9e0..4467ed3a6e 100644
--- a/docs/ref/contrib/sitemaps.txt
+++ b/docs/ref/contrib/sitemaps.txt
@@ -358,7 +358,7 @@ with a caching decorator -- you must name your sitemap view and pass
from django.views.decorators.cache import cache_page
urlpatterns = patterns('',
- url(r'^sitemap.xml$',
+ url(r'^sitemap\.xml$',
cache_page(86400)(sitemaps_views.index),
{'sitemaps': sitemaps, 'sitemap_url_name': 'sitemaps'}),
url(r'^sitemap-(?P<section>.+)\.xml$',
diff --git a/docs/ref/databases.txt b/docs/ref/databases.txt
index a648ac1709..4e5f136e2e 100644
--- a/docs/ref/databases.txt
+++ b/docs/ref/databases.txt
@@ -623,6 +623,14 @@ If you're getting this error, you can solve it by:
SQLite does not support the ``SELECT ... FOR UPDATE`` syntax. Calling it will
have no effect.
+"pyformat" parameter style in raw queries not supported
+-------------------------------------------------------
+
+For most backends, raw queries (``Manager.raw()`` or ``cursor.execute()``)
+can use the "pyformat" parameter style, where placeholders in the query
+are given as ``'%(name)s'`` and the parameters are passed as a dictionary
+rather than a list. SQLite does not support this.
+
.. _sqlite-connection-queries:
Parameters not quoted in ``connection.queries``
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt
index 8146dfd341..f5c1058b17 100644
--- a/docs/ref/models/fields.txt
+++ b/docs/ref/models/fields.txt
@@ -1083,6 +1083,22 @@ define the details of how the relation works.
user = models.ForeignKey(User, related_name='+')
+.. attribute:: ForeignKey.related_query_name
+
+ .. versionadded:: 1.6
+
+ The name to use for the reverse filter name from the target model.
+ Defaults to the value of :attr:`related_name` if it is set, otherwise it
+ defaults to the name of the model::
+
+ # Declare the ForeignKey with related_query_name
+ class Tag(models.Model):
+ article = models.ForeignKey(Article, related_name="tags", related_query_name="tag")
+ name = models.CharField(max_length=255)
+
+ # That's now the name of the reverse filter
+ article_instance.filter(tag__name="important")
+
.. attribute:: ForeignKey.to_field
The field on the related object that the relation is to. By default, Django
@@ -1207,6 +1223,12 @@ that control how the relationship functions.
users = models.ManyToManyField(User, related_name='u+')
referents = models.ManyToManyField(User, related_name='ref+')
+.. attribute:: ForeignKey.related_query_name
+
+ .. versionadded:: 1.6
+
+ Same as :attr:`ForeignKey.related_query_name`.
+
.. attribute:: ManyToManyField.limit_choices_to
Same as :attr:`ForeignKey.limit_choices_to`.
diff --git a/docs/ref/models/instances.txt b/docs/ref/models/instances.txt
index cfc95db092..17c9aa9fb7 100644
--- a/docs/ref/models/instances.txt
+++ b/docs/ref/models/instances.txt
@@ -679,8 +679,11 @@ For every :class:`~django.db.models.DateField` and
returns the next and previous object with respect to the date field, raising
a :exc:`~django.core.exceptions.DoesNotExist` exception when appropriate.
-Both methods accept optional keyword arguments, which should be in the format
-described in :ref:`Field lookups <field-lookups>`.
+Both of these methods will perform their queries using the default
+manager for the model. If you need to emulate filtering used by a
+custom manager, or want to perform one-off custom filtering, both
+methods also accept optional keyword arguments, which should be in the
+format described in :ref:`Field lookups <field-lookups>`.
Note that in the case of identical date values, these methods will use the
primary key as a tie-breaker. This guarantees that no records are skipped or
diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt
index 897af275a0..215931768c 100644
--- a/docs/ref/settings.txt
+++ b/docs/ref/settings.txt
@@ -1350,8 +1350,14 @@ A data structure containing configuration information. The contents of
this data structure will be passed as the argument to the
configuration method described in :setting:`LOGGING_CONFIG`.
-The default logging configuration passes HTTP 500 server errors to an
-email log handler; all other log messages are given to a NullHandler.
+Among other things, the default logging configuration passes HTTP 500 server
+errors to an email log handler when :setting:`DEBUG` is ``False``. See also
+:ref:`configuring-logging`.
+
+You can see the default logging configuration by looking in
+``django/utils/log.py`` (or view the `online source`__).
+
+__ https://github.com/django/django/blob/master/django/utils/log.py
.. setting:: LOGGING_CONFIG
@@ -2564,7 +2570,9 @@ various locations.
The default will find files stored in the :setting:`STATICFILES_DIRS` setting
(using ``django.contrib.staticfiles.finders.FileSystemFinder``) and in a
``static`` subdirectory of each app (using
-``django.contrib.staticfiles.finders.AppDirectoriesFinder``)
+``django.contrib.staticfiles.finders.AppDirectoriesFinder``). If multiple
+files with the same name are present, the first file that is found will be
+used.
One finder is disabled by default:
``django.contrib.staticfiles.finders.DefaultStorageFinder``. If added to
diff --git a/docs/ref/signals.txt b/docs/ref/signals.txt
index 06ba2cb3e8..0253832b8d 100644
--- a/docs/ref/signals.txt
+++ b/docs/ref/signals.txt
@@ -255,7 +255,7 @@ Arguments sent with this signal:
``pk_set``
For the ``pre_add``, ``post_add``, ``pre_remove`` and ``post_remove``
- actions, this is a list of primary key values that have been added to
+ actions, this is a set of primary key values that have been added to
or removed from the relation.
For the ``pre_clear`` and ``post_clear`` actions, this is ``None``.
@@ -284,7 +284,7 @@ If we connected a handler like this::
and then did something like this::
- >>> p = Pizza.object.create(...)
+ >>> p = Pizza.objects.create(...)
>>> t = Topping.objects.create(...)
>>> p.toppings.add(t)
@@ -307,7 +307,7 @@ Argument Value
``model`` ``Topping`` (the class of the objects added to the
``Pizza``)
-``pk_set`` ``[t.id]`` (since only ``Topping t`` was added to the relation)
+``pk_set`` ``set([t.id])`` (since only ``Topping t`` was added to the relation)
``using`` ``"default"`` (since the default router sends writes here)
============== ============================================================
@@ -334,7 +334,7 @@ Argument Value
``model`` ``Pizza`` (the class of the objects removed from the
``Topping``)
-``pk_set`` ``[p.id]`` (since only ``Pizza p`` was removed from the
+``pk_set`` ``set([p.id])`` (since only ``Pizza p`` was removed from the
relation)
``using`` ``"default"`` (since the default router sends writes here)
diff --git a/docs/ref/utils.txt b/docs/ref/utils.txt
index 45d7781403..8d722829fb 100644
--- a/docs/ref/utils.txt
+++ b/docs/ref/utils.txt
@@ -649,6 +649,20 @@ escaping HTML.
Converts a positive integer to a base 36 string. On Python 2 ``i`` must be
smaller than :data:`sys.maxint`.
+.. function:: urlsafe_base64_encode(s)
+
+ .. versionadded:: 1.6
+
+ Encodes a bytestring in base64 for use in URLs, stripping any trailing
+ equal signs.
+
+.. function:: urlsafe_base64_decode(s)
+
+ .. versionadded:: 1.6
+
+ Decodes a base64 encoded string, adding back any trailing equal signs that
+ might have been stripped.
+
``django.utils.module_loading``
===============================