linkahead.common.datatype module
- linkahead.common.datatype.get_id_of_datatype(datatype: str) int
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:
QueryNotUniqueError – If there are more than one entities with the same name as the datatype.
EmptyUniqueQueryError – If there is no entity with the name of the datatype.
- linkahead.common.datatype.get_list_datatype(datatype: str, strict: bool = False) str | None
Returns the datatype of the elements in the list. If it not a list, return None.
- linkahead.common.datatype.get_referenced_recordtype(datatype: str) str
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:
- linkahead.common.datatype.is_list_datatype(datatype: str) bool
returns whether the datatype is a list