mirror of
https://github.com/jazzband/django-configurations.git
synced 2026-05-17 20:11:08 +00:00
More permissive BooleanValue-s
This commit is contained in:
parent
5ece107044
commit
04a1cb6bb2
2 changed files with 7 additions and 7 deletions
|
|
@ -108,8 +108,8 @@ class MultipleMixin(object):
|
|||
|
||||
|
||||
class BooleanValue(Value):
|
||||
true_values = ('yes', 'y', 'true', '1')
|
||||
false_values = ('no', 'n', 'false', '0', '')
|
||||
true_values = ('yes','Yes', 'y', 'Y', 'true', 'True', 'TRUE', '1')
|
||||
false_values = ('no','No', 'n', 'N', 'false', 'False', 'FALSE', '0', '')
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(BooleanValue, self).__init__(*args, **kwargs)
|
||||
|
|
|
|||
|
|
@ -197,8 +197,8 @@ Type values
|
|||
A :class:`~Value` subclass that checks and returns boolean values. Possible
|
||||
values for environment variables are:
|
||||
|
||||
- ``True`` values: ``'yes'``, ``'y'``, ``'true'``, ``'1'``
|
||||
- ``False`` values: ``'no'``, ``'n'``, ``'false'``, ``'0'``,
|
||||
- ``True`` values: ``'yes'``, ``'Yes'``, ``'y'``, ``'Y'``, ``'true'``, ``'True'``, ``'TRUE'``, ``'1'``
|
||||
- ``False`` values: ``'no'``, ``'No'``, ``'n'``, ``'N'``, ``'false'``, ``'False'``, ``'FALSE'``, ``'0'``,
|
||||
``''`` (empty string)
|
||||
|
||||
::
|
||||
|
|
@ -281,13 +281,13 @@ Type values
|
|||
|
||||
:param seq_separator: the separator to split each tuple with
|
||||
:param separator: the separator to split the inner tuple contents with
|
||||
:param converter: the optional converter callable to apply for each inner
|
||||
:param converter: the optional converter callable to apply for each inner
|
||||
tuple item
|
||||
|
||||
Useful for ADMINS, MANAGERS, and the like. For example::
|
||||
|
||||
ADMINS = SingleNestedTupleValue((
|
||||
('John', 'jcleese@site.com'),
|
||||
('John', 'jcleese@site.com'),
|
||||
('Eric', 'eidle@site.com'),
|
||||
))
|
||||
|
||||
|
|
@ -302,7 +302,7 @@ Type values
|
|||
|
||||
:param seq_separator: the separator to split each list with
|
||||
:param separator: the separator to split the inner list contents with
|
||||
:param converter: the optional converter callable to apply for each inner
|
||||
:param converter: the optional converter callable to apply for each inner
|
||||
list item
|
||||
|
||||
See the :class:`~SingleNestedTupleValue` examples above.
|
||||
|
|
|
|||
Loading…
Reference in a new issue