def delphi_solution_votes(row):
 if hasattr(row, 'delphi_solution'):
  row = row.delphi_solution
 try:
  solution_id = row.id
  problem_id = row.problem_id
 except AttributeError:
  return None
 vtable = current.s3db.delphi_vote
 query = (vtable.solution_id == solution_id)
 votes = current.db(query).count()
 url = URL(c='delphi', f='problem', args=[problem_id, 'results'])
 return A(votes, _href=url)

def delphi_solution_votes ( row ) : if hasattr ( row , 'delphi_solution' ) : row = row . delphi_solution try : solution_id = row . id problem_id = row . problem_id except AttributeError : return None vtable = current . s3db . delphi_vote query = ( vtable . solution_id == solution_id ) votes = current . db ( query ) . count ( ) url = URL ( c = 'delphi' , f = 'problem' , args = [ problem_id , 'results' ] ) return A ( votes , _href = url )
clickable number of solutions for a problem .