Burgerlib Python
Loading...
Searching...
No Matches
burger.validators.StringListProperty Class Reference

Class to enforce string list in member variable. More...

Inheritance diagram for burger.validators.StringListProperty:
Collaboration diagram for burger.validators.StringListProperty:

Public Member Functions

 __get__ (self, instance, owner=None)
 Return value.
 __set__ (self, instance, value)
 Set the string value.
Public Member Functions inherited from burger.validators.Property
 __init__ (self, name)
 Initialize to default.
 __get__ (self, instance, owner=None)
 Return value.
 __set__ (self, instance, value)
 Set the string value.

Additional Inherited Members

Protected Attributes inherited from burger.validators.Property
 _name = name
 The real name of the class instance.

Detailed Description

Class to enforce string list in member variable.

Examples

"Inherit from (object) for Python 2.7"
>>> class foo(object):
"Init to [\"foo\"]"
x = StringListProperty("foo")
"Init to None"
y = StringListProperty()
"Init to [\"a\",\"b\",\"c\"]"
z = StringListProperty(["a","b","c"])
"Create the class"
f = foo()
"Print [\"foo\"]"
print(f.x)
"Print [\"False\"]"
f.x = "False"
print(f.x)
"Print True"
f.x = True
print(f.x)

Member Function Documentation

◆ __get__()

burger.validators.StringListProperty.__get__ ( self,
instance,
owner = None )

Return value.

Parameters
instanceReference to object containing data
ownerNot used
Returns
None, or verified data

◆ __set__()

burger.validators.StringListProperty.__set__ ( self,
instance,
value )

Set the string value.

Parameters
instanceReference to object containing data
valueNone or value the can be converted to bool