diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2009-01-14 10:17:39 -0700 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2009-01-14 10:17:39 -0700 |
commit | cc5d7e8adb5882573a47883208e6ac8e60f35002 (patch) | |
tree | fb9855fe8c5d9043d8cf3572fc2e02c7e1f18fbb /ipalib | |
parent | 05514292dcf2448f0340e09cd0da88f815c43c5b (diff) | |
download | freeipa-cc5d7e8adb5882573a47883208e6ac8e60f35002.tar.gz freeipa-cc5d7e8adb5882573a47883208e6ac8e60f35002.tar.xz freeipa-cc5d7e8adb5882573a47883208e6ac8e60f35002.zip |
New Param: Small docstring change in Flag
Diffstat (limited to 'ipalib')
-rw-r--r-- | ipalib/parameter.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/ipalib/parameter.py b/ipalib/parameter.py index 0617c84da..bfe601a93 100644 --- a/ipalib/parameter.py +++ b/ipalib/parameter.py @@ -632,6 +632,7 @@ class Bool(Param): """ type = bool + type_error = _('must be True or False') class Flag(Bool): @@ -645,16 +646,23 @@ class Flag(Bool): For example: - >>> Flag('my_flag') - Flag('my_flag', autofill=True, default=False) - >>> Flag('my_flag', default=True) # Do this for default of True - Flag('my_flag', autofill=True, default=True) + >>> flag = Flag('my_flag') + >>> (flag.autofill, flag.default) + (True, False) + + To have a default value of ``True``, create your `Flag` intance with + ``default=True``. For example: + + >>> flag = Flag('my_flag', default=True) + >>> (flag.autofill, flag.default) + (True, True) Also note that creating a `Flag` instance with ``autofill=False`` will have no effect. For example: - >>> Flag('my_flag', autofill=False) # autofill will still be True - Flag('my_flag', autofill=True, default=False) + >>> flag = Flag('my_flag', autofill=False) + >>> flag.autofill + True """ def __init__(self, name, *rules, **kw): |