From b9eb800a916e911094021fa4efb06deedc8ebf15 Mon Sep 17 00:00:00 2001 From: Ankush Chadda Date: Sat, 10 Sep 2016 16:18:52 +0530 Subject: [PATCH] Documentation changes for Ordered fields in admin --- docs/index.rst | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index 71fec82..39f8f30 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -118,8 +118,24 @@ Note: Use later evaluated strings instead of direct classes for the field and wi 'MY_SELECT_KEY': ('yes', 'select yes or no', 'yes_no_null_select'), } +Ordered Fields in admin +----------------------- + +In order to Order the fields , you can use OrderedDict collection. Here is an example: + +.. code-block:: python + + from collections import OrderedDict + + CONSTANCE_CONFIG = OrderedDict([ + ('SITE_NAME', ('My Title', 'Website title')), + ('SITE_DESCRIPTION', ('', 'Website description')), + ('THEME', ('light-blue', 'Website theme')), + ] + + Fieldsets -------------- +--------- To group settings together you can define fieldsets. Here's an example: