'Look up the UUID of a record
@param tablename: the table name
@param record_id: the record ID
@return: the UUID of the specified record, or None if
the record does not exist or has no UUID'

@staticmethod
def get_uuid(tablename, record_id):

    table = current.s3db.table(tablename)
    if ((not table) or ('uuid' not in table.fields)):
        return None
    query = (table._id == record_id)
    if ('deleted' in table.fields):
        query &= (table.deleted == False)
    row = current.db(query).select(table.uuid, limitby=(0, 1)).first()
    return ((row.uuid or None) if row else None)
