def survey_template_represent(template_id, row=None):
    """
        Display the template name rather than the id
    """

    if row:
        return row.name
    elif not template_id:
        return current.messages["NONE"]

    table = current.s3db.survey_template
    query = (table.id == template_id)
    record = current.db(query).select(table.name,
                                      limitby=(0, 1)).first()
    try:
        return record.name
    except __HOLE__:
        return current.messages.UNKNOWN_OPT

# =============================================================================
dataset/ETHPy150Open sahana/eden/modules/s3db/survey.py/survey_template_represent