def as_dict(self): ''' Return the report as a dictionary :return: The dictionary ''' from collections import OrderedDict result = OrderedDict() result['tables'] = dict([(table.name, table.as_dict()) for table in self.tables ]) result['arrays'] = dict([(array.name, array.as_dict()) for array in self.arrays ]) return result
def as_dict(self): ''' Return the report as a dictionary :return: The dictionary ''' from collections import OrderedDict result = OrderedDict() result['tables'] = { table.name: table.as_dict() for table in self.tables } result['arrays'] = { array.name: array.as_dict() for array in self.arrays } return result
def as_dict(self): """ Return the report as a dictionary :return: The dictionary """ from collections import OrderedDict result = OrderedDict() result["tables"] = { table.name: table.as_dict() for table in self.tables } result["arrays"] = { array.name: array.as_dict() for array in self.arrays } return result