mirror of
https://github.com/jazzband/django-constance.git
synced 2026-03-16 22:40:24 +00:00
Fix formatting of CONSTANCE_ADDITIONAL_FIELDS doc
This commit is contained in:
parent
468daf5eea
commit
cd3756f8e2
1 changed files with 9 additions and 8 deletions
|
|
@ -69,6 +69,7 @@ You can set the field type by the third value in the `CONSTANCE_CONFIG`
|
|||
tuple. The value can be string or one of the supported types:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
'THE_ANSWER': (42, 'Answer to the Ultimate Question of Life, '
|
||||
'The Universe, and Everything', str),
|
||||
|
||||
|
|
@ -77,17 +78,17 @@ If you can add your custom field types, you can use the
|
|||
use later evaluated strings instead of direct classes:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
CONSTANCE_ADDITIONAL_FIELDS = {
|
||||
'yes_no_null_select': ['django.forms.fields.ChoiceField',
|
||||
{
|
||||
'widget': 'django.forms.Select',
|
||||
'choices': (("-----", None), ("yes", "Yes"), ("no", "No"))
|
||||
}],
|
||||
'yes_no_null_select': ['django.forms.fields.ChoiceField', {
|
||||
'widget': 'django.forms.Select',
|
||||
'choices': (("-----", None), ("yes", "Yes"), ("no", "No"))
|
||||
}],
|
||||
}
|
||||
|
||||
CONSTANCE_CONFIG = {
|
||||
'MY_SELECT_KEY': ('yes', 'select yes or no', 'yes_no_null_select'),
|
||||
}
|
||||
CONSTANCE_CONFIG = {
|
||||
'MY_SELECT_KEY': ('yes', 'select yes or no', 'yes_no_null_select'),
|
||||
}
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
|
|
|||
Loading…
Reference in a new issue