def __setitem__(self, name, value):
"""
Implements the [] operator. Used to set property value(s).
:param name: Name of the property to set.
:type name: str
:param value: Any value to set tot the property.
:raises: :exc:`BadPropertyError` if the property name is the \
empty string or not a string.
:raises: :exc:`BadValueError` if the value is not a supported type.
"""
if isinstance(value,list) or isinstance(value,tuple):
# We cant store an empty list, so we catch any attempts
# and store None. As "does not exists" queries aren't
# possible anyway, this makes no difference
if len( value ) == 0:
value = None
super( Entity, self ).__setitem__( name, value )
评论列表
文章目录