#NEWLINE# def update_taking( self , cursor = None ) : #NEWLINE# #INDENT# ( cursor or self . db ) . run ( '\n\n            UPDATE participants\n               SET taking=COALESCE((SELECT sum(receiving) FROM teams WHERE owner=%(username)s), 0)\n                 , ntaking_from=COALESCE((SELECT count(*) FROM teams WHERE owner=%(username)s), 0)\n             WHERE username=%(username)s\n\n        ' , dict ( username = self . username ) )