diff options
| author | areski <areski@gmail.com> | 2014-08-18 16:30:44 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-08-19 16:44:25 -0400 |
| commit | 9d6551204eff9d1ab70b67578f99630716df7490 (patch) | |
| tree | f8a8722912985f6b0876d58909880df172a77703 /docs/ref | |
| parent | fa02120d360387bebbbe735e86686bb4c7c43db2 (diff) | |
Removed unnecessary code-block directives.
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/contrib/admin/index.txt | 4 | ||||
| -rw-r--r-- | docs/ref/contrib/gis/install/geolibs.txt | 10 | ||||
| -rw-r--r-- | docs/ref/contrib/gis/install/spatialite.txt | 4 | ||||
| -rw-r--r-- | docs/ref/forms/widgets.txt | 6 | ||||
| -rw-r--r-- | docs/ref/utils.txt | 19 |
5 files changed, 16 insertions, 27 deletions
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index 4c0543cd1f..29b5abdc24 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/docs/ref/contrib/admin/index.txt @@ -2567,9 +2567,7 @@ Adding a password-reset feature ------------------------------- You can add a password-reset feature to the admin site by adding a few lines to -your URLconf. Specifically, add these four patterns: - -.. code-block:: python +your URLconf. Specifically, add these four patterns:: from django.contrib.auth import views as auth_views diff --git a/docs/ref/contrib/gis/install/geolibs.txt b/docs/ref/contrib/gis/install/geolibs.txt index 458a5b72e0..bfd9af6528 100644 --- a/docs/ref/contrib/gis/install/geolibs.txt +++ b/docs/ref/contrib/gis/install/geolibs.txt @@ -149,9 +149,7 @@ If using a binary package of GEOS (e.g., on Ubuntu), you may need to :ref:`binut If your GEOS library is in a non-standard location, or you don't want to modify the system's library path then the :setting:`GEOS_LIBRARY_PATH` setting may be added to your Django settings file with the full path to the -GEOS C library. For example: - -.. code-block:: python +GEOS C library. For example:: GEOS_LIBRARY_PATH = '/home/bob/local/lib/libgeos_c.so' @@ -237,7 +235,7 @@ Can't find GDAL library When GeoDjango can't find the GDAL library, the ``HAS_GDAL`` flag will be false: -.. code-block:: python +.. code-block:: pycon >>> from django.contrib.gis import gdal >>> gdal.HAS_GDAL @@ -254,9 +252,7 @@ The solution is to properly configure your :ref:`libsettings` *or* set If your GDAL library is in a non-standard location, or you don't want to modify the system's library path then the :setting:`GDAL_LIBRARY_PATH` setting may be added to your Django settings file with the full path to -the GDAL library. For example: - -.. code-block:: python +the GDAL library. For example:: GDAL_LIBRARY_PATH = '/home/sue/local/lib/libgdal.so' diff --git a/docs/ref/contrib/gis/install/spatialite.txt b/docs/ref/contrib/gis/install/spatialite.txt index efcc7ca2b3..472d19f8ab 100644 --- a/docs/ref/contrib/gis/install/spatialite.txt +++ b/docs/ref/contrib/gis/install/spatialite.txt @@ -180,9 +180,7 @@ location available in your ``PATH``. For example:: $ sudo cp spatialite /Library/Frameworks/SQLite3.framework/Programs Finally, for GeoDjango to be able to find the KyngChaos SpatiaLite library, -add the following to your ``settings.py``: - -.. code-block:: python +add the following to your ``settings.py``:: SPATIALITE_LIBRARY_PATH='/Library/Frameworks/SQLite3.framework/SQLite3' diff --git a/docs/ref/forms/widgets.txt b/docs/ref/forms/widgets.txt index fe5920eee3..a2245a5ffa 100644 --- a/docs/ref/forms/widgets.txt +++ b/docs/ref/forms/widgets.txt @@ -198,7 +198,7 @@ foundation for custom widgets. A dictionary containing HTML attributes to be set on the rendered widget. - .. code-block:: python + .. code-block:: pycon >>> from django import forms >>> name = forms.TextInput(attrs={'size': 10, 'title': 'Your name',}) @@ -772,9 +772,7 @@ Composite widgets An optional dict of months to use in the "months" select box. The keys of the dict correspond to the month number (1-indexed) and - the values are the displayed months. - - .. code-block:: python + the values are the displayed months:: MONTHS = { 1:_('jan'), 2:_('feb'), 3:_('mar'), 4:_('apr'), diff --git a/docs/ref/utils.txt b/docs/ref/utils.txt index 2f2b15de35..9c44bbb840 100644 --- a/docs/ref/utils.txt +++ b/docs/ref/utils.txt @@ -432,9 +432,7 @@ Atom1Feed Consider a typical case, where a view might need to call a model's method to perform some computation, before placing the model instance into the - context, where the template might invoke the method once more: - - .. code-block:: python + context, where the template might invoke the method once more:: # the model class Person(models.Model): @@ -446,8 +444,12 @@ Atom1Feed # in the view: if person.friends(): + ... + + And in the template you would have: + + .. code-block:: html+django - # in the template: {% for friend in person.friends %} Here, ``friends()`` will be called twice. Since the instance ``person`` in @@ -467,6 +469,7 @@ Atom1Feed # in the view: if person.friends: + ... The cached value can be treated like an ordinary attribute of the instance:: @@ -573,18 +576,14 @@ escaping HTML. because it applies escaping to all arguments - just like the Template system applies escaping by default. - So, instead of writing: - - .. code-block:: python + So, instead of writing:: mark_safe("%s <b>%s</b> %s" % (some_html, escape(some_text), escape(some_other_text), )) - you should instead use: - - .. code-block:: python + You should instead use:: format_html("{0} <b>{1}</b> {2}", mark_safe(some_html), some_text, some_other_text) |
