def delphi_solution_comments(row):
 if hasattr(row, 'delphi_solution'):
  row = row.delphi_solution
 try:
  solution_id = row.id
  problem_id = row.problem_id
 except AttributeError:
  return None
 ctable = current.s3db.delphi_comment
 query = (ctable.solution_id == solution_id)
 comments = current.db(query).count()
 url = URL(c='delphi', f='problem', args=[problem_id, 'solution', solution_id, 'discuss'])
 return A(comments, _href=url)

def delphi_solution_comments ( row ) : if hasattr ( row , 'delphi_solution' ) : row = row . delphi_solution try : solution_id = row . id problem_id = row . problem_id except AttributeError : return None ctable = current . s3db . delphi_comment query = ( ctable . solution_id == solution_id ) comments = current . db ( query ) . count ( ) url = URL ( c = 'delphi' , f = 'problem' , args = [ problem_id , 'solution' , solution_id , 'discuss' ] ) return A ( comments , _href = url )
clickable number of comments for a solution .