def getID(self, id, data_load = None): # data_load exists for compatibility with calls in jr_common # reservation records are small enough that we always load all fields from a data row search_id = toList(id) results = super(data_dao, self).getID(search_id, table = self.table) if results: for record in results: self.__get_virtual(record) if type(id) == list: return results else: if results: return results[-1] else: return None
def getID(self, id, data_load = DATA_LOAD.ALL): # default is ALL to indicate full load desired by default search_id = toList(id) if data_load in [DATA_LOAD.LAST_SUMMARY, DATA_LOAD.ALL_SUMMARY]: results = super(data_dao, self).getID(search_id, self.summary_fields, self.table) else: results = super(data_dao, self).getID(search_id, "*", self.table) if results: for record in results: if data_load not in [DATA_LOAD.LAST_SUMMARY, DATA_LOAD.ALL_SUMMARY]: self.__get_virtual(record) if type(id) == list: return results else: if results: return results[-1] else: return None
def by_data_id(self, data_id): return self.searchFields([(self.dataID_field_name, SRCHCMP.IN, toList(data_id))])
def cobaltid(self, jobid): return self.searchFields([("JOBID", SRCHCMP.IN, toList(jobid))], orderSet = [("ENTRY_TIME", "+")])
def cobaltid(self, resid): return self.searchFields([("RESID", SRCHCMP.IN, toList(resid))], orderSet = [("ENTRY_TIME", "+")])