+ to_cache[cache_key] = (datetime.datetime.now(), [
+ (row.__dict__[on_cache_query_attr], dict([(k, row.__dict__[k]) for k in self.query.aggregates.keys()]))
+ for row in to_return])
+ elif with_aggregates:
+ tmp = key_list
+ key_list = [k[0] for k in tmp]
+ with_aggregates = [k[1] for k in tmp]
+ del tmp