Package mobi :: Package mtld :: Package da :: Module property :: Class Property
[frames] | no frames]

Class Property

object --+
         |
        Property

Contains a property value and data type id. The value can be fetched as a generic Object or one of the convenience methods can be used to get the value in a specific type.


Copyright: Copyright (c) Afilias Technologies Limited 2021. All Rights Reserved.

Author: Afilias Technologies Limited

Instance Methods
 
__init__(self, value, data_type)
Create a new Property with a value and data type.
 
data_type(self)
Get data type name.
 
__iter__(self)
Get a set of possible values for this property.
 
__bool__(self)
Get the value of the property as a boolean (Python 3.x)
 
__nonzero__(self)
 
__int__(self)
Get the value of the property as an integer.
 
__str__(self)
Get the value of the property as a string.
 
__eq__(self, other)
Opposite to __ne__()
 
__ne__(self, other)
Compare two instances of this class.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Static Methods
 
normalize_string(possible_unicode_str)
Return a string representation of the parameter passed, encoding as UTF-8 in case of encoding error and replacing accented by unaccented characters.
 
list_to_normalized_string(lst)
Properties
  value
  data_type_id

Inherited from object: __class__

Method Details

__init__(self, value, data_type)
(Constructor)

 

Create a new Property with a value and data type.

Parameters:
  • value - The value to store.
  • data_type - The type of the value to store. Data types are defined in class DataType.
Overrides: object.__init__

data_type(self)

 

Get data type name. It returns a String with the data type name

__iter__(self)

 

Get a set of possible values for this property. This is typically only used when it is known that a given property name can have multiple possible values. All items in the set will have the same data type. It returns the array value of the property.

__str__(self)
(Informal representation operator)

 

Get the value of the property as a string. If a property has multiple possible values then the values are concatenated with a comma.

Overrides: object.__str__

__ne__(self, other)

 

Compare two instances of this class. If both have equal values and data type then returns False.

normalize_string(possible_unicode_str)
Static Method

 

Return a string representation of the parameter passed, encoding as UTF-8 in case of encoding error and replacing accented by unaccented characters.

Parameters:
  • possible_unicode_str

Property Details

value

Get Method:
unreachable.value(self)

data_type_id

Get Method:
unreachable.data_type_id(self)