def sum(self, sum_field, filters=[]): res = 0 for o in self.__records: if Helper.is_in_filer(o, filters): if isinstance(sum_field, str) and isinstance(o, AbstractRecord): res += int(fields(o)[sum_field]) # * len(o.get_status().split(' - ')) return res
def count(self, filters=[]): res = 0 for o in self.__records: if isinstance(o, AbstractRecord) and Helper.is_in_filer(o, filters): res += 1 # * len(o.status().split(' - ')) return res