owmeta_core.custom_dataobject_property module¶
- class owmeta_core.custom_dataobject_property.CustomProperty(*args, **kwargs)[source]¶
Bases:
Contextualizable
,DataUser
Store a value associated with a DataObject
Properties can be be accessed like methods. A method call like:
a.P()
for a property
P
will return values appropriate to that property fora
, theowner
of the property.- Parameters
- owner
owmeta_core.dataobject.DataObject
The owner of this property
- name
str
The name of this property. Can be accessed as an attribute like:
owner.name
- owner
- get(*args)[source]¶
Get the things which are on the other side of this property
The return value must be iterable. For a
get
that just returns a single value, an easy way to make an iterable is to wrap the value in a tuple like(value,)
.Derived classes must override.
- get_terms(*args)¶
Get the things which are on the other side of this property
The return value must be iterable. For a
get
that just returns a single value, an easy way to make an iterable is to wrap the value in a tuple like(value,)
.Derived classes must override.
- has_value()[source]¶
Returns true if the
CustomProperty
has any values set on it.This may be defined differently for each property
- one()[source]¶
Returns a single value for the
CustomProperty
whether or not it is multivalued.