'Represent a Twitter account'

@staticmethod
def twitter_represent(nickname, show_link=True):

    if (not nickname):
        return current.messages['NONE']
    db = current.db
    s3db = current.s3db
    table = s3db.pr_contact
    query = ((table.contact_method == 'TWITTER') & (table.value == nickname))
    row = db(query).select(table.pe_id, limitby=(0, 1)).first()
    if row:
        repr = s3db.pr_pentity_represent(row.pe_id)
        if show_link:
            ptable = s3db.pr_person
            row = db((ptable.pe_id == row.pe_id)).select(ptable.id, limitby=(0, 1)).first()
            if row:
                link = URL(c='pr', f='person', args=[row.id])
                return A(repr, _href=link)
        return repr
    else:
        return nickname
