'Represent an alert template concisely'

@staticmethod
def cap_template_represent(id, row=None):

    if row:
        id = row.id
    elif (not id):
        return current.messages['NONE']
    else:
        db = current.db
        table = db.cap_alert
        row = db((table.id == id)).select(table.is_template, table.template_title, limitby=(0, 1)).first()
    try:
        if row.is_template:
            return row.template_title
        else:
            return s3db.cap_alert_represent(id)
    except:
        return current.messages.UNKNOWN_OPT
