'FK representation
@ToDo: Migrate to S3Represent'

@staticmethod
def delphi_problem_represent(id, row=None, show_link=False, solutions=True):

    if (not row):
        db = current.db
        table = db.delphi_problem
        row = db((table.id == id)).select(table.id, table.name, limitby=(0, 1)).first()
    elif (not id):
        return current.messages['NONE']
    try:
        if show_link:
            if solutions:
                url = URL(c='delphi', f='problem', args=[row.id, 'solution'])
            else:
                url = URL(c='delphi', f='problem', args=[row.id])
            return A(row.name, _href=url)
        else:
            return row.name
    except:
        return current.messages.UNKNOWN_OPT
