linkahead.common.datatype module

linkahead.common.datatype.LIST(datatype)
linkahead.common.datatype.get_id_of_datatype(datatype)

returns the id of a Record Type

This is not trivial, as queries may also return children. A check comparing names is necessary.

Parameters:

datatype (string) – A datatype, e.g. DOUBLE, or LIST<Person>

Return type:

The id of the RecordType with the same name as the datatype.

Raises:
linkahead.common.datatype.get_list_datatype(datatype: str, strict: bool = False)

Returns the datatype of the elements in the list. If it not a list, return None.

linkahead.common.datatype.get_referenced_recordtype(datatype)

Return the record type of the referenced datatype.

Raises:

ValueError – In cases where datatype is not a reference, the list does not have a referenced record type or the datatype is a FILE.

Parameters:

datatype (str) – The datatype to check.

Returns:

String containing the name of the referenced datatype.

Return type:

str

linkahead.common.datatype.is_list_datatype(datatype)

returns whether the datatype is a list

linkahead.common.datatype.is_reference(datatype)

Returns whether the value is a reference

FILE and REFERENCE properties are examples, but also datatypes that are RecordTypes.

Parameters:

datatype (str) – The datatype to check.

Returns:

True if the datatype is a not base datatype or a list of a base datatype. Otherwise False is returned.

Return type:

bool