'Update the computed values on the team.'

def update_distributing(self, new_takes, cursor=None):

    distributing = sum((t[u'actual_amount'] for t in new_takes.values()))
    ndistributing_to = len(tuple((t for t in new_takes.values() if (t[u'actual_amount'] > 0))))
    r = (cursor or self.db).one(u'\n                                                            UPDATE    teams\n                                                                        SET    distributing=%s,    ndistributing_to=%s    WHERE    id=%s\n                                                RETURNING    distributing,    ndistributing_to\n                                ', (distributing, ndistributing_to, self.id))
    self.set_attributes(**r._asdict())
