From 0b475a41f8f64f3cda258ef9a2954e191366372a Mon Sep 17 00:00:00 2001 From: blag Date: Tue, 21 Feb 2017 15:39:55 -0700 Subject: [PATCH] Add info about customizing template From issue #57. --- README.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.rst b/README.rst index cf0a5bc..ce680d3 100644 --- a/README.rst +++ b/README.rst @@ -80,6 +80,21 @@ Only you need it, if you want the translation of django-multiselectfield ) +Customizing templates +--------------------- + +It is possible to customize the HTML of this widget in your form template. To do so, you will need to loop through ``form.{field}.field.choices``. Here is an example that displays the field label underneath/after the checkbox for a ``MultiSelectField`` called ``providers``: + +.. code-block:: HTML+Django + + {% for value, text in form.providers.field.choices %} +
+ + +
+ {% endfor %} + + Django REST Framework ---------------------