Permalink
Browse files

Added missing markup to docs.

  • Loading branch information...
1 parent 0df59bc commit 93cffc3b37d7ef7a20c53f9001f0451a37be7584 @timgraham timgraham committed Mar 22, 2013
@@ -222,9 +222,9 @@ parameters:
* :attr:`~django.db.models.Field.db_tablespace`: Only for index creation, if the
backend supports :doc:`tablespaces </topics/db/tablespaces>`. You can usually
ignore this option.
-* ``auto_created``: True if the field was
- automatically created, as for the `OneToOneField` used by model
- inheritance. For advanced use only.
+* ``auto_created``: ``True`` if the field was automatically created, as for the
+ :class:`~django.db.models.OneToOneField` used by model inheritance. For
+ advanced use only.
All of the options without an explanation in the above list have the same
meaning they do for normal Django fields. See the :doc:`field documentation
@@ -111,7 +111,7 @@ See the :doc:`Django 1.3 release notes</releases/1.3>` for more details on
these changes.
* Starting Django without a :setting:`SECRET_KEY` will result in an exception
- rather than a `DeprecationWarning`. (This is accelerated from the usual
+ rather than a ``DeprecationWarning``. (This is accelerated from the usual
deprecation path; see the :doc:`Django 1.4 release notes</releases/1.4>`.)
* The ``mod_python`` request handler will be removed. The ``mod_wsgi``
@@ -107,7 +107,7 @@ with::
url(r'^admin/', include(admin.site.urls)),
)
-You have now wired an `index` view into the URLconf. Go to
+You have now wired an ``index`` view into the URLconf. Go to
http://localhost:8000/polls/ in your browser, and you should see the text
"*Hello, world. You're at the poll index.*", which you defined in the
``index`` view.
@@ -119,7 +119,7 @@ At this point, it's worth reviewing what these arguments are for.
:func:`~django.conf.urls.url` argument: regex
---------------------------------------------
-The term `regex` is a commonly used short form meaning `regular expression`,
+The term "regex" is a commonly used short form meaning "regular expression",
which is a syntax for matching patterns in strings, or in this case, url
patterns. Django starts at the first regular expression and makes its way down
the list, comparing the requested URL against each regular expression until it
@@ -35,8 +35,8 @@ YearMixin
Tries the following sources, in order:
* The value of the :attr:`YearMixin.year` attribute.
- * The value of the `year` argument captured in the URL pattern.
- * The value of the `year` GET query argument.
+ * The value of the ``year`` argument captured in the URL pattern.
+ * The value of the ``year`` ``GET`` query argument.
Raises a 404 if no valid year specification can be found.
@@ -87,8 +87,8 @@ MonthMixin
Tries the following sources, in order:
* The value of the :attr:`MonthMixin.month` attribute.
- * The value of the `month` argument captured in the URL pattern.
- * The value of the `month` GET query argument.
+ * The value of the ``month`` argument captured in the URL pattern.
+ * The value of the ``month`` ``GET`` query argument.
Raises a 404 if no valid month specification can be found.
@@ -139,8 +139,8 @@ DayMixin
Tries the following sources, in order:
* The value of the :attr:`DayMixin.day` attribute.
- * The value of the `day` argument captured in the URL pattern.
- * The value of the `day` GET query argument.
+ * The value of the ``day`` argument captured in the URL pattern.
+ * The value of the ``day`` ``GET`` query argument.
Raises a 404 if no valid day specification can be found.
@@ -192,8 +192,8 @@ WeekMixin
Tries the following sources, in order:
* The value of the :attr:`WeekMixin.week` attribute.
- * The value of the `week` argument captured in the URL pattern
- * The value of the `week` GET query argument.
+ * The value of the ``week`` argument captured in the URL pattern
+ * The value of the ``week`` ``GET`` query argument.
Raises a 404 if no valid week specification can be found.
@@ -59,7 +59,7 @@ SingleObjectMixin
this view will display. By default, :meth:`get_queryset` returns the
value of the :attr:`queryset` attribute if it is set, otherwise
it constructs a :class:`~django.db.models.query.QuerySet` by calling
- the `all()` method on the :attr:`model` attribute's default manager.
+ the ``all()`` method on the :attr:`model` attribute's default manager.
.. method:: get_context_object_name(obj)
View
@@ -30,10 +30,10 @@ Preventing clickjacking
Modern browsers honor the `X-Frame-Options`_ HTTP header that indicates whether
or not a resource is allowed to load within a frame or iframe. If the response
-contains the header with a value of SAMEORIGIN then the browser will only load
-the resource in a frame if the request originated from the same site. If the
-header is set to DENY then the browser will block the resource from loading in a
-frame no matter which site made the request.
+contains the header with a value of ``SAMEORIGIN`` then the browser will only
+load the resource in a frame if the request originated from the same site. If
+the header is set to ``DENY`` then the browser will block the resource from
+loading in a frame no matter which site made the request.
.. _X-Frame-Options: https://developer.mozilla.org/en/The_X-FRAME-OPTIONS_response_header
@@ -51,7 +51,7 @@ How to use it
Setting X-Frame-Options for all responses
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-To set the same X-Frame-Options value for all responses in your site, put
+To set the same ``X-Frame-Options`` value for all responses in your site, put
``'django.middleware.clickjacking.XFrameOptionsMiddleware'`` to
:setting:`MIDDLEWARE_CLASSES`::
@@ -65,15 +65,15 @@ To set the same X-Frame-Options value for all responses in your site, put
This middleware is enabled in the settings file generated by
:djadmin:`startproject`.
-By default, the middleware will set the X-Frame-Options header to SAMEORIGIN for
-every outgoing ``HttpResponse``. If you want DENY instead, set the
-:setting:`X_FRAME_OPTIONS` setting::
+By default, the middleware will set the ``X-Frame-Options`` header to
+``SAMEORIGIN`` for every outgoing ``HttpResponse``. If you want ``DENY``
+instead, set the :setting:`X_FRAME_OPTIONS` setting::
X_FRAME_OPTIONS = 'DENY'
When using the middleware there may be some views where you do **not** want the
-X-Frame-Options header set. For those cases, you can use a view decorator that
-tells the middleware not to set the header::
+``X-Frame-Options`` header set. For those cases, you can use a view decorator
+that tells the middleware not to set the header::
from django.http import HttpResponse
from django.views.decorators.clickjacking import xframe_options_exempt
@@ -86,7 +86,7 @@ tells the middleware not to set the header::
Setting X-Frame-Options per view
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-To set the X-Frame-Options header on a per view basis, Django provides these
+To set the ``X-Frame-Options`` header on a per view basis, Django provides these
decorators::
from django.http import HttpResponse
@@ -107,8 +107,8 @@ a decorator overrides the middleware.
Limitations
===========
-The `X-Frame-Options` header will only protect against clickjacking in a modern
-browser. Older browsers will quietly ignore the header and need `other
+The ``X-Frame-Options`` header will only protect against clickjacking in a
+modern browser. Older browsers will quietly ignore the header and need `other
clickjacking prevention techniques`_.
Browsers that support X-Frame-Options
@@ -123,7 +123,7 @@ Browsers that support X-Frame-Options
See also
~~~~~~~~
-A `complete list`_ of browsers supporting X-Frame-Options.
+A `complete list`_ of browsers supporting ``X-Frame-Options``.
.. _complete list: https://developer.mozilla.org/en/The_X-FRAME-OPTIONS_response_header#Browser_compatibility
.. _other clickjacking prevention techniques: http://en.wikipedia.org/wiki/Clickjacking#Prevention
@@ -175,7 +175,7 @@ That's easy enough to do::
make_published.short_description = "Mark selected stories as published"
Notice first that we've moved ``make_published`` into a method and renamed the
-`modeladmin` parameter to `self`, and second that we've now put the string
+``modeladmin`` parameter to ``self``, and second that we've now put the string
``'make_published'`` in ``actions`` instead of a direct function reference. This
tells the :class:`ModelAdmin` to look up the action as a method.
@@ -181,7 +181,7 @@ protecting the CSRF token from being sent to other domains.
correctly on that version. Make sure you are running at least jQuery 1.5.1.
You can use `settings.crossDomain <http://api.jquery.com/jQuery.ajax>`_ in
-jQuery 1.5 and newer in order to replace the `sameOrigin` logic above:
+jQuery 1.5 and newer in order to replace the ``sameOrigin`` logic above:
.. code-block:: javascript
@@ -634,8 +634,8 @@ systems and coordinate transformation::
or any other input accepted by :class:`SpatialReference` (including
spatial reference WKT and PROJ.4 strings, or an integer SRID).
By default nothing is returned and the geometry is transformed in-place.
- However, if the `clone` keyword is set to ``True`` then a transformed clone
- of this geometry is returned instead.
+ However, if the ``clone`` keyword is set to ``True`` then a transformed
+ clone of this geometry is returned instead.
.. method:: intersects(other)
@@ -454,8 +454,8 @@ cron script, or some other scheduled task. The function makes an HTTP request
to Google's servers, so you may not want to introduce that network overhead
each time you call ``save()``.
-Pinging Google via `manage.py`
-------------------------------
+Pinging Google via ``manage.py``
+--------------------------------
.. django-admin:: ping_google
@@ -1385,7 +1385,7 @@ For example, to dump data from the database with the alias ``master``::
.. django-admin-option:: --exclude
Exclude a specific application from the applications whose contents is
-output. For example, to specifically exclude the `auth` application from
+output. For example, to specifically exclude the ``auth`` application from
the output of dumpdata, you would call::
django-admin.py dumpdata --exclude=auth
@@ -872,8 +872,8 @@ widget for this field is a :class:`~django.forms.NullBooleanSelect`.
.. class:: PositiveIntegerField([**options])
-Like an :class:`IntegerField`, but must be either positive or zero (`0`).
-The value `0` is accepted for backward compatibility reasons.
+Like an :class:`IntegerField`, but must be either positive or zero (``0``).
+The value ``0`` is accepted for backward compatibility reasons.
``PositiveSmallIntegerField``
-----------------------------
View
@@ -2174,7 +2174,7 @@ Settings for :mod:`django.contrib.messages`.
MESSAGE_LEVEL
-------------
-Default: `messages.INFO`
+Default: ``messages.INFO``
Sets the minimum message level that will be recorded by the messages
framework. See :ref:`message levels <message-level>` for more details.
@@ -120,7 +120,7 @@ Methods
rendered :class:`~django.template.response.SimpleTemplateResponse`
instance.
- If the callback returns a value that is not `None`, this will be
+ If the callback returns a value that is not ``None``, this will be
used as the response instead of the original response object (and
will be passed to the next post rendering callback etc.)
View
@@ -23,12 +23,12 @@ The ``optional_dictionary`` and ``optional_name`` parameters are described in
:ref:`Passing extra options to view functions <views-extra-options>`.
.. note::
- Because `patterns()` is a function call, it accepts a maximum of 255
+ Because ``patterns()`` is a function call, it accepts a maximum of 255
arguments (URL patterns, in this case). This is a limit for all Python
function calls. This is rarely a problem in practice, because you'll
- typically structure your URL patterns modularly by using `include()`
+ typically structure your URL patterns modularly by using ``include()``
sections. However, on the off-chance you do hit the 255-argument limit,
- realize that `patterns()` returns a Python list, so you can split up the
+ realize that ``patterns()`` returns a Python list, so you can split up the
construction of the list.
::
@@ -428,7 +428,7 @@ Support for multiple databases
Django 1.2 adds the ability to use :doc:`more than one database
</topics/db/multi-db>` in your Django project. Queries can be
-issued at a specific database with the `using()` method on
+issued at a specific database with the ``using()`` method on
querysets; individual objects can be saved to a specific database
by providing a ``using`` argument when you save the instance.
View
@@ -123,9 +123,9 @@ Support for multiple databases
Django 1.2 adds the ability to use :doc:`more than one database
</topics/db/multi-db>` in your Django project. Queries can be issued at a
-specific database with the `using()` method on ``QuerySet`` objects. Individual
-objects can be saved to a specific database by providing a ``using`` argument
-when you call ``save()``.
+specific database with the ``using()`` method on ``QuerySet`` objects.
+Individual objects can be saved to a specific database by providing a ``using``
+argument when you call ``save()``.
Model validation
----------------
@@ -765,7 +765,7 @@ over the next few release cycles.
Code taking advantage of any of the features below will raise a
``PendingDeprecationWarning`` in Django 1.2. This warning will be
silent by default, but may be turned on using Python's :mod:`warnings`
-module, or by running Python with a ``-Wd`` or `-Wall` flag.
+module, or by running Python with a ``-Wd`` or ``-Wall`` flag.
In Django 1.3, these warnings will become a ``DeprecationWarning``,
which is *not* silent. In Django 1.4 support for these features will
@@ -277,7 +277,7 @@ over the next few release cycles.
Code taking advantage of any of the features below will raise a
``PendingDeprecationWarning`` in Django 1.3. This warning will be
silent by default, but may be turned on using Python's :mod:`warnings`
-module, or by running Python with a ``-Wd`` or `-Wall` flag.
+module, or by running Python with a ``-Wd`` or ``-Wall`` flag.
In Django 1.4, these warnings will become a ``DeprecationWarning``,
which is *not* silent. In Django 1.5 support for these features will
@@ -154,7 +154,7 @@ too few.
In Django 1.3 we're taking a new approach to this problem, implemented
as a pair of changes:
-* The choice list for `USStateField` has changed. Previously, it
+* The choice list for ``USStateField`` has changed. Previously, it
consisted of the 50 U.S. states, the District of Columbia and
U.S. overseas territories. As of Django 1.3 it includes all previous
choices, plus the U.S. Armed Forces postal codes.
@@ -163,7 +163,7 @@ as a pair of changes:
``django.contrib.localflavor.us.models.USPostalCodeField``, has
been added which draws its choices from a list of all postal
abbreviations recognized by the U.S Postal Service. This includes
- all abbreviations recognized by `USStateField`, plus three
+ all abbreviations recognized by ``USStateField``, plus three
independent nations -- the Federated States of Micronesia, the
Republic of the Marshall Islands and the Republic of Palau -- which
are serviced under treaty by the U.S. postal system. A new form
@@ -176,7 +176,7 @@ territories, and other locations serviced by the U.S. postal
system. Consult the ``django.contrib.localflavor`` documentation
for more details.
-The change to `USStateField` is technically backwards-incompatible for
+The change to ``USStateField`` is technically backwards-incompatible for
users who expect this field to exclude Armed Forces locations. If you
need to support U.S. mailing addresses without Armed Forces locations,
see the list of choice tuples available in the localflavor
View
@@ -662,7 +662,7 @@ over the next few release cycles.
Code taking advantage of any of the features below will raise a
``PendingDeprecationWarning`` in Django 1.3. This warning will be
silent by default, but may be turned on using Python's :mod:`warnings`
-module, or by running Python with a ``-Wd`` or `-Wall` flag.
+module, or by running Python with a ``-Wd`` or ``-Wall`` flag.
In Django 1.4, these warnings will become a ``DeprecationWarning``,
which is *not* silent. In Django 1.5 support for these features will
@@ -878,7 +878,7 @@ removed.
The ``open`` method of the base Storage class took an obscure parameter
``mixin`` which allowed you to dynamically change the base classes of the
returned file object. This has been removed. In the rare case you relied on the
-`mixin` parameter, you can easily achieve the same by overriding the `open`
+``mixin`` parameter, you can easily achieve the same by overriding the ``open``
method, e.g.::
from django.core.files import File
@@ -946,7 +946,7 @@ removed.
The ``open`` method of the base Storage class took an obscure parameter
``mixin`` which allowed you to dynamically change the base classes of the
returned file object. This has been removed. In the rare case you relied on the
-`mixin` parameter, you can easily achieve the same by overriding the `open`
+``mixin`` parameter, you can easily achieve the same by overriding the ``open``
method, e.g.::
from django.core.files import File
View
@@ -1040,7 +1040,7 @@ removed.
The ``open`` method of the base Storage class used to take an obscure parameter
``mixin`` that allowed you to dynamically change the base classes of the
returned file object. This has been removed. In the rare case you relied on the
-`mixin` parameter, you can easily achieve the same by overriding the `open`
+``mixin`` parameter, you can easily achieve the same by overriding the ``open``
method, like this::
from django.core.files import File
Oops, something went wrong.

0 comments on commit 93cffc3

Please sign in to comment.