From 8f8faf3c60932f0ab645e4a581bc0b7b86028802 Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev <fedoseev.sergey@gmail.com> Date: Tue, 30 Oct 2018 17:29:11 +0500 Subject: [PATCH] Fixed some formatting in 'Customising IndexView' doc. (#4877) * Fixed some formatting in 'Customising IndexView' doc. * Make coverage omit docs/conf.py. --- .coveragerc | 1 + .../reference/contrib/modeladmin/indexview.rst | 18 ++++++------------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.coveragerc b/.coveragerc index 5713778546..e2e7969b81 100644 --- a/.coveragerc +++ b/.coveragerc @@ -6,6 +6,7 @@ source = wagtail omit = */migrations/* + docs/conf.py [report] diff --git a/docs/reference/contrib/modeladmin/indexview.rst b/docs/reference/contrib/modeladmin/indexview.rst index b3d23a9e75..13cb736231 100644 --- a/docs/reference/contrib/modeladmin/indexview.rst +++ b/docs/reference/contrib/modeladmin/indexview.rst @@ -25,16 +25,10 @@ on the ``ModelAdmin`` class itself. Default value: ``('__str__',)`` -Set ``list_display`` to control which fields are displayed in the IndexView +Set ``list_display`` to control which fields are displayed in the ``IndexView`` for your model. -Example - -``` -list_display = ('first_name', 'last_name') -``` - -You have three possible values that can be used in list_display: +You have three possible values that can be used in ``list_display``: - A field of the model. For example: @@ -370,12 +364,12 @@ For example: **Must return**: A dictionary -The `get_extra_attrs_for_row` method allows you to add html attributes to -the opening `<tr>` tag for each result, in addition to the `data-object_pk` and -`class` attributes already added by the `result_row_display` tag. +The ``get_extra_attrs_for_row`` method allows you to add html attributes to +the opening ``<tr>`` tag for each result, in addition to the ``data-object_pk`` and +``class`` attributes already added by the ``result_row_display`` template tag. If you want to add additional CSS classes, simply provide those class names -as a string value using the `class` key, and the `odd`/`even` will be appended +as a string value using the ``'class'`` key, and the ``odd``/``even`` will be appended to your custom class names when rendering. For example, if you wanted to add some additional class names based on field