From f9c28386ab0b648b7858b4b1a7789f6f3df0d72c Mon Sep 17 00:00:00 2001 From: Ryan P Kilby Date: Tue, 8 Nov 2016 11:50:44 -0500 Subject: [PATCH] Small doc style fixes --- docs/ref/fields.txt | 4 +++- docs/ref/settings.txt | 2 +- docs/ref/widgets.txt | 8 ++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/ref/fields.txt b/docs/ref/fields.txt index 9640917..d73c493 100644 --- a/docs/ref/fields.txt +++ b/docs/ref/fields.txt @@ -11,7 +11,9 @@ Defines a class level attribute ``ISO_8601`` as constant for the format. Sets ``input_formats = [ISO_8601]`` — this means that by default ``IsoDateTimeField`` will **only** parse ISO 8601 formated dates. -You may set ``input_formats`` to your list of required formats as per the `DateTimeField Docs`_, using the ``ISO_8601`` class level attribute to specify the ISO 8601 format. :: +You may set ``input_formats`` to your list of required formats as per the `DateTimeField Docs`_, using the ``ISO_8601`` class level attribute to specify the ISO 8601 format. + +.. code-block:: python f = IsoDateTimeField() f.input_formats = [IsoDateTimeField.ISO_8601] + DateTimeField.input_formats diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index e3f721d..bc59ca9 100644 --- a/docs/ref/settings.txt +++ b/docs/ref/settings.txt @@ -92,6 +92,6 @@ For example, you could add verbose output for "exact" lookups. FILTERS_STRICTNESS ------------------ -DEFAULT: ``STRICTNESS.RETURN_NO_RESULTS`` +Default: ``STRICTNESS.RETURN_NO_RESULTS`` Set the global default for FilterSet :ref:`strictness `. diff --git a/docs/ref/widgets.txt b/docs/ref/widgets.txt index 89f4e44..6af96d5 100644 --- a/docs/ref/widgets.txt +++ b/docs/ref/widgets.txt @@ -30,7 +30,9 @@ placeholders: This widget converts its input into Python's True/False values. It will convert all case variations of ``True`` and ``False`` into the internal Python values. -To use it, pass this into the ``widgets`` argument of the ``BooleanFilter``:: +To use it, pass this into the ``widgets`` argument of the ``BooleanFilter``: + +.. code-block:: python active = BooleanFilter(widget=BooleanWidget()) @@ -54,6 +56,8 @@ This widget is used with ``RangeFilter`` and its subclasses. It generates two form input elements which generally act as start/end values in a range. Under the hood, it is django's ``forms.TextInput`` widget and excepts the same arguments and values. To use it, pass it to ``widget`` argument of -a ``RangeField``:: +a ``RangeField``: + +.. code-block:: python date_range = DateFromToRangeFilter(widget=RangeWidget(attrs={'placeholder': 'YYYY/MM/DD'}))