From 43f366d9559e9b96e673608f615faabff71a97be Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Tue, 8 Oct 2019 09:38:03 -0500 Subject: [PATCH] Improve docs a bit, for `GridFilter.set_choices()` --- tailbone/grids/filters.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tailbone/grids/filters.py b/tailbone/grids/filters.py index 3a497d13..e136aa21 100644 --- a/tailbone/grids/filters.py +++ b/tailbone/grids/filters.py @@ -192,6 +192,17 @@ class GridFilter(object): """ Set the value choices for the filter, post-construction. Note that this also will set the value renderer to one which supports choices. + + :param choices: A collection of "choices" for the filter. This must be + in one of the following formats: + + * simple list, each value of which should be a string, which is + assumed to be able to serve as both key and value (ordering of + choices will be preserved) + * simple dict, keys and values of which will define the choices + (note that the final choices will be sorted by key!) + * OrderedDict, keys and values of which will define the choices + (ordering of choices will be preserved) """ # first must normalize choices if isinstance(choices, OrderedDict):