Fixed #20852 - Fixed incorrectly generated left quotes in docs.
Sphinx generates left single quotes for apostrophes after code markup, when right single quotes are required. The easiest way to fix this is just by inserting the unicode character for a right single quote. Instances of the problem were found by looking for ">‘" in the generated HTML.
This commit is contained in:
parent
0b771fcf29
commit
c33d1ca1d9
|
@ -193,7 +193,7 @@ Attributes
|
|||
----------
|
||||
|
||||
All attributes can be set in your derived class and can be used in
|
||||
:class:`BaseCommand`'s :ref:`subclasses<ref-basecommand-subclasses>`.
|
||||
:class:`BaseCommand`’s :ref:`subclasses<ref-basecommand-subclasses>`.
|
||||
|
||||
.. attribute:: BaseCommand.args
|
||||
|
||||
|
@ -267,7 +267,7 @@ the :meth:`~BaseCommand.handle` method must be implemented.
|
|||
.. admonition:: Implementing a constructor in a subclass
|
||||
|
||||
If you implement ``__init__`` in your subclass of :class:`BaseCommand`,
|
||||
you must call :class:`BaseCommand`'s ``__init__``.
|
||||
you must call :class:`BaseCommand`’s ``__init__``.
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
|
|
|
@ -120,8 +120,8 @@ Filtering sensitive information
|
|||
Error reports are really helpful for debugging errors, so it is generally
|
||||
useful to record as much relevant information about those errors as possible.
|
||||
For example, by default Django records the `full traceback`_ for the
|
||||
exception raised, each `traceback frame`_'s local variables, and the
|
||||
:class:`~django.http.HttpRequest`'s :ref:`attributes<httprequest-attributes>`.
|
||||
exception raised, each `traceback frame`_’s local variables, and the
|
||||
:class:`~django.http.HttpRequest`’s :ref:`attributes<httprequest-attributes>`.
|
||||
|
||||
However, sometimes certain types of information may be too sensitive and thus
|
||||
may not be appropriate to be kept track of, for example a user's password or
|
||||
|
@ -164,7 +164,7 @@ production environment (that is, where :setting:`DEBUG` is set to ``False``):
|
|||
.. admonition:: When using mutiple decorators
|
||||
|
||||
If the variable you want to hide is also a function argument (e.g.
|
||||
'``user``' in the following example), and if the decorated function has
|
||||
'``user``’ in the following example), and if the decorated function has
|
||||
mutiple decorators, then make sure to place ``@sensitive_variables`` at
|
||||
the top of the decorator chain. This way it will also hide the function
|
||||
argument as it gets passed through the other decorators::
|
||||
|
@ -232,7 +232,7 @@ own filter class and tell Django to use it via the
|
|||
DEFAULT_EXCEPTION_REPORTER_FILTER = 'path.to.your.CustomExceptionReporterFilter'
|
||||
|
||||
You may also control in a more granular way which filter to use within any
|
||||
given view by setting the ``HttpRequest``'s ``exception_reporter_filter``
|
||||
given view by setting the ``HttpRequest``’s ``exception_reporter_filter``
|
||||
attribute::
|
||||
|
||||
def my_view(request):
|
||||
|
|
|
@ -132,7 +132,7 @@ We identify a bug
|
|||
Fortunately, there's a little bug in the ``polls`` application for us to fix
|
||||
right away: the ``Poll.was_published_recently()`` method returns ``True`` if
|
||||
the ``Poll`` was published within the last day (which is correct) but also if
|
||||
the ``Poll``'s ``pub_date`` field is in the future (which certainly isn't).
|
||||
the ``Poll``’s ``pub_date`` field is in the future (which certainly isn't).
|
||||
|
||||
You can see this in the Admin; create a poll whose date lies in the future;
|
||||
you'll see that the ``Poll`` change list claims it was published recently.
|
||||
|
|
|
@ -225,7 +225,7 @@ DateMixin
|
|||
.. attribute:: date_field
|
||||
|
||||
The name of the ``DateField`` or ``DateTimeField`` in the
|
||||
``QuerySet``'s model that the date-based archive should use to
|
||||
``QuerySet``’s model that the date-based archive should use to
|
||||
determine the list of objects to display on the page.
|
||||
|
||||
When :doc:`time zone support </topics/i18n/timezones>` is enabled and
|
||||
|
|
|
@ -1615,7 +1615,7 @@ in your own admin JavaScript without including a second copy, you can use the
|
|||
The embedded jQuery has been upgraded from 1.4.2 to 1.9.1.
|
||||
|
||||
The :class:`ModelAdmin` class requires jQuery by default, so there is no need
|
||||
to add jQuery to your ``ModelAdmin``'s list of media resources unless you have
|
||||
to add jQuery to your ``ModelAdmin``’s list of media resources unless you have
|
||||
a specifc need. For example, if you require the jQuery library to be in the
|
||||
global namespace (for example when using third-party jQuery plugins) or if you
|
||||
need a newer version of jQuery, you will have to include your own copy.
|
||||
|
|
|
@ -243,7 +243,7 @@ Manager methods
|
|||
be called.
|
||||
|
||||
The ``extra_fields`` keyword arguments are passed through to the
|
||||
:class:`~django.contrib.auth.models.User`'s ``__init__`` method to
|
||||
:class:`~django.contrib.auth.models.User`’s ``__init__`` method to
|
||||
allow setting arbitrary fields on a :ref:`custom User model
|
||||
<auth-custom-user>`.
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ following model, which would represent entries in a Weblog::
|
|||
Now, suppose that we want the following steps to be applied whenever a
|
||||
new comment is posted on an ``Entry``:
|
||||
|
||||
1. If the ``Entry``'s ``enable_comments`` field is ``False``, the
|
||||
1. If the ``Entry``’s ``enable_comments`` field is ``False``, the
|
||||
comment will simply be disallowed (i.e., immediately deleted).
|
||||
|
||||
2. If the ``enable_comments`` field is ``True``, the comment will be
|
||||
|
|
|
@ -560,7 +560,7 @@ several lines in language files.
|
|||
|
||||
.. django-admin-option:: --no-location
|
||||
|
||||
Use the ``--no-location`` option to not write '``#: filename:line``'
|
||||
Use the ``--no-location`` option to not write '``#: filename:line``’
|
||||
comment lines in language files. Note that using this option makes it harder
|
||||
for technically skilled translators to understand each message's context.
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ Django quotes column and table names behind the scenes.
|
|||
|
||||
The name of an orderable field in the model, typically a :class:`DateField`,
|
||||
:class:`DateTimeField`, or :class:`IntegerField`. This specifies the default
|
||||
field to use in your model :class:`Manager`'s
|
||||
field to use in your model :class:`Manager`’s
|
||||
:meth:`~django.db.models.query.QuerySet.latest` and
|
||||
:meth:`~django.db.models.query.QuerySet.earliest` methods.
|
||||
|
||||
|
|
|
@ -1924,7 +1924,7 @@ as_manager
|
|||
.. versionadded:: 1.7
|
||||
|
||||
Class method that returns an instance of :class:`~django.db.models.Manager`
|
||||
with a copy of the ``QuerySet``'s methods. See
|
||||
with a copy of the ``QuerySet``’s methods. See
|
||||
:ref:`create-manager-with-queryset-methods` for more details.
|
||||
|
||||
.. _field-lookups:
|
||||
|
|
|
@ -1744,7 +1744,7 @@ Default::
|
|||
|
||||
A tuple of template loader classes, specified as strings. Each ``Loader`` class
|
||||
knows how to import templates from a particular source. Optionally, a tuple can be
|
||||
used instead of a string. The first item in the tuple should be the ``Loader``'s
|
||||
used instead of a string. The first item in the tuple should be the ``Loader``’s
|
||||
module, subsequent items are passed to the ``Loader`` during initialization. See
|
||||
:doc:`/ref/templates/api`.
|
||||
|
||||
|
@ -2478,7 +2478,7 @@ files</howto/static-files/index>` for more details about usage.
|
|||
your static files from their permanent locations into one directory for
|
||||
ease of deployment; it is **not** a place to store your static files
|
||||
permanently. You should do that in directories that will be found by
|
||||
:doc:`staticfiles</ref/contrib/staticfiles>`'s
|
||||
:doc:`staticfiles</ref/contrib/staticfiles>`’s
|
||||
:setting:`finders<STATICFILES_FINDERS>`, which by default, are
|
||||
``'static/'`` app sub-directories and any directories you include in
|
||||
:setting:`STATICFILES_DIRS`).
|
||||
|
|
|
@ -708,7 +708,7 @@ class. Here are the template loaders that come with Django:
|
|||
with your own ``admin/base_site.html`` in ``myproject.polls``. You must
|
||||
then make sure that your ``myproject.polls`` comes *before*
|
||||
``django.contrib.admin`` in :setting:`INSTALLED_APPS`, otherwise
|
||||
``django.contrib.admin``'s will be loaded first and yours will be ignored.
|
||||
``django.contrib.admin``’s will be loaded first and yours will be ignored.
|
||||
|
||||
Note that the loader performs an optimization when it is first imported:
|
||||
it caches a list of which :setting:`INSTALLED_APPS` packages have a
|
||||
|
|
|
@ -365,7 +365,7 @@ In earlier Django versions, when a model instance containing a
|
|||
file from the backend storage. This opened the door to several data-loss
|
||||
scenarios, including rolled-back transactions and fields on different models
|
||||
referencing the same file. In Django 1.3, when a model is deleted the
|
||||
:class:`~django.db.models.FileField`'s ``delete()`` method won't be called. If
|
||||
:class:`~django.db.models.FileField`’s ``delete()`` method won't be called. If
|
||||
you need cleanup of orphaned files, you'll need to handle it yourself (for
|
||||
instance, with a custom management command that can be run manually or
|
||||
scheduled to run periodically via e.g. cron).
|
||||
|
@ -654,7 +654,7 @@ Password reset view now accepts ``from_email``
|
|||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The :func:`django.contrib.auth.views.password_reset` view now accepts a
|
||||
``from_email`` parameter, which is passed to the ``password_reset_form``'s
|
||||
``from_email`` parameter, which is passed to the ``password_reset_form``’s
|
||||
``save()`` method as a keyword argument. If you are using this view with a
|
||||
custom password reset form, then you will need to ensure your form's ``save()``
|
||||
method accepts this keyword argument.
|
||||
|
|
|
@ -183,7 +183,7 @@ Minor features
|
|||
|
||||
* The :attr:`~django.views.generic.edit.DeletionMixin.success_url` of
|
||||
:class:`~django.views.generic.edit.DeletionMixin` is now interpolated with
|
||||
its ``object``\'s ``__dict__``.
|
||||
its ``object``’s ``__dict__``.
|
||||
|
||||
* :class:`~django.http.HttpResponseRedirect` and
|
||||
:class:`~django.http.HttpResponsePermanentRedirect` now provide an ``url``
|
||||
|
@ -330,7 +330,7 @@ Minor features
|
|||
|
||||
* :class:`~django.forms.ModelForm` fields can now override error messages
|
||||
defined in model fields by using the
|
||||
:attr:`~django.forms.Field.error_messages` argument of a ``Field``'s
|
||||
:attr:`~django.forms.Field.error_messages` argument of a ``Field``’s
|
||||
constructor. To take advantage of this new feature with your custom fields,
|
||||
:ref:`see the updated recommendation <raising-validation-error>` for raising
|
||||
a ``ValidationError``.
|
||||
|
|
|
@ -141,7 +141,7 @@ Miscellaneous
|
|||
have a custom :class:`~django.core.files.uploadhandler.FileUploadHandler`
|
||||
that implements ``new_file()``, be sure it accepts this new parameter.
|
||||
|
||||
* :class:`ModelFormSet<django.forms.models.BaseModelFormSet>`'s no longer
|
||||
* :class:`ModelFormSet<django.forms.models.BaseModelFormSet>`’s no longer
|
||||
delete instances when ``save(commit=False)`` is called. See
|
||||
:attr:`~django.forms.formsets.BaseFormSet.can_delete` for instructions on how
|
||||
to manually delete objects from deleted forms.
|
||||
|
|
|
@ -288,7 +288,7 @@ object. In order to do this, we need to have two different querysets:
|
|||
|
||||
``Book`` queryset for use by :class:`~django.views.generic.list.ListView`
|
||||
Since we have access to the ``Publisher`` whose books we want to list, we
|
||||
simply override ``get_queryset()`` and use the ``Publisher``'s
|
||||
simply override ``get_queryset()`` and use the ``Publisher``’s
|
||||
:ref:`reverse foreign key manager<backwards-related-objects>`.
|
||||
|
||||
``Publisher`` queryset for use in :meth:`~django.views.generic.detail.SingleObjectMixin.get_object()`
|
||||
|
|
|
@ -100,7 +100,7 @@ access ``self.model`` to get the model class to which they're attached.
|
|||
Modifying initial Manager QuerySets
|
||||
-----------------------------------
|
||||
|
||||
A ``Manager``'s base ``QuerySet`` returns all objects in the system. For
|
||||
A ``Manager``’s base ``QuerySet`` returns all objects in the system. For
|
||||
example, using this model::
|
||||
|
||||
from django.db import models
|
||||
|
@ -111,7 +111,7 @@ example, using this model::
|
|||
|
||||
...the statement ``Book.objects.all()`` will return all books in the database.
|
||||
|
||||
You can override a ``Manager``\'s base ``QuerySet`` by overriding the
|
||||
You can override a ``Manager``’s base ``QuerySet`` by overriding the
|
||||
``Manager.get_queryset()`` method. ``get_queryset()`` should return a
|
||||
``QuerySet`` with the properties you require.
|
||||
|
||||
|
@ -246,7 +246,7 @@ Creating ``Manager`` with ``QuerySet`` methods
|
|||
In lieu of the above approach which requires duplicating methods on both the
|
||||
``QuerySet`` and the ``Manager``, :meth:`QuerySet.as_manager()
|
||||
<django.db.models.query.QuerySet.as_manager>` can be used to create an instance
|
||||
of ``Manager`` with a copy of a custom ``QuerySet``'s methods::
|
||||
of ``Manager`` with a copy of a custom ``QuerySet``’s methods::
|
||||
|
||||
class Person(models.Model):
|
||||
...
|
||||
|
|
|
@ -720,7 +720,7 @@ efficient code.
|
|||
In a newly created :class:`~django.db.models.query.QuerySet`, the cache is
|
||||
empty. The first time a :class:`~django.db.models.query.QuerySet` is evaluated
|
||||
-- and, hence, a database query happens -- Django saves the query results in
|
||||
the :class:`~django.db.models.query.QuerySet`\'s cache and returns the results
|
||||
the :class:`~django.db.models.query.QuerySet`’s cache and returns the results
|
||||
that have been explicitly requested (e.g., the next element, if the
|
||||
:class:`~django.db.models.query.QuerySet` is being iterated over). Subsequent
|
||||
evaluations of the :class:`~django.db.models.query.QuerySet` reuse the cached
|
||||
|
|
|
@ -30,7 +30,7 @@ Declaring tablespaces for indexes
|
|||
---------------------------------
|
||||
|
||||
You can pass the :attr:`~django.db.models.Field.db_tablespace` option to a
|
||||
``Field`` constructor to specify an alternate tablespace for the ``Field``'s
|
||||
``Field`` constructor to specify an alternate tablespace for the ``Field``’s
|
||||
column index. If no index would be created for the column, the option is
|
||||
ignored.
|
||||
|
||||
|
|
|
@ -392,7 +392,7 @@ these security concerns do not apply to you:
|
|||
model = Author
|
||||
fields = '__all__'
|
||||
|
||||
2. Set the ``exclude`` attribute of the ``ModelForm``'s inner ``Meta`` class to
|
||||
2. Set the ``exclude`` attribute of the ``ModelForm``’s inner ``Meta`` class to
|
||||
a list of fields to be excluded from the form.
|
||||
|
||||
For example::
|
||||
|
@ -757,7 +757,7 @@ Specifying widgets to use in the form with ``widgets``
|
|||
.. versionadded:: 1.6
|
||||
|
||||
Using the ``widgets`` parameter, you can specify a dictionary of values to
|
||||
customize the ``ModelForm``'s widget class for a particular field. This
|
||||
customize the ``ModelForm``’s widget class for a particular field. This
|
||||
works the same way as the ``widgets`` dictionary on the inner ``Meta``
|
||||
class of a ``ModelForm`` works::
|
||||
|
||||
|
|
Loading…
Reference in New Issue