mirror of
https://github.com/jazzband/django-constance.git
synced 2026-05-20 05:11:53 +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:
|
tuple. The value can be string or one of the supported types:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
'THE_ANSWER': (42, 'Answer to the Ultimate Question of Life, '
|
'THE_ANSWER': (42, 'Answer to the Ultimate Question of Life, '
|
||||||
'The Universe, and Everything', str),
|
'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:
|
use later evaluated strings instead of direct classes:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
CONSTANCE_ADDITIONAL_FIELDS = {
|
CONSTANCE_ADDITIONAL_FIELDS = {
|
||||||
'yes_no_null_select': ['django.forms.fields.ChoiceField',
|
'yes_no_null_select': ['django.forms.fields.ChoiceField', {
|
||||||
{
|
'widget': 'django.forms.Select',
|
||||||
'widget': 'django.forms.Select',
|
'choices': (("-----", None), ("yes", "Yes"), ("no", "No"))
|
||||||
'choices': (("-----", None), ("yes", "Yes"), ("no", "No"))
|
}],
|
||||||
}],
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CONSTANCE_CONFIG = {
|
CONSTANCE_CONFIG = {
|
||||||
'MY_SELECT_KEY': ('yes', 'select yes or no', 'yes_no_null_select'),
|
'MY_SELECT_KEY': ('yes', 'select yes or no', 'yes_no_null_select'),
|
||||||
}
|
}
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
-----
|
-----
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue