# --------------------------------------------------------------------------------------------------------- # Author : Ulrich Carmesin # Source : gitea.ucarmesin.de # --------------------------------------------------------------------------------------------------------- import basic.constants as B import model.entity FIELD_ID = "dtid" FIELD_NAME = "name" FIELD_DESCRIPTION = B.SUBJECT_DESCRIPTION FIELD_REFERENCE = B.SUBJECT_REFERENCE FIELD_COMPONENT = B.SUBJECT_COMP FIELD_ATTRIBUTES = B.NODE_ATTRIBUTES FIELD_HEADER = "" LIST_FIELDS = [FIELD_ID, FIELD_NAME, FIELD_DESCRIPTION, FIELD_REFERENCE, FIELD_COMPONENT] LIST_NODES = [B.DATA_NODE_HEADER, B.DATA_NODE_DATA, B.DATA_NODE_FIELDS] LIST_SUBTABLES = {} class Datatable(model.entity.Entity): dcid = 0 document = "" description = "" project = "" reference = "" def __init__(self, job, project="", name=""): """ to be initialized by readSpec :param job: """ self.job = job def getFieldList(self): """ returns a list of scalar attributes :return: LIST_FIELDS """ return LIST_FIELDS def getNodeList(self): """ returns a list of sub-nodes - which can be persisted in a clob-field :return: LIST_NODES """ return LIST_NODES def getSubtableList(self): """ returns a list of sub-tables :return: LIST_SUBTABLES """ return LIST_SUBTABLES def getName(self): """ returns the name - maybe build from other attributes :return: """ return self.name def getIDName(self): """ it returns the name as unique-id - maybe build from few attributes :return: """ return self.name