'Check whether a table exposes a mobile form
@param tablename: the table name
@return: True|False'

@staticmethod
def has_mobile_form(tablename):

    from s3model import DYNAMIC_PREFIX
    if tablename.startswith(DYNAMIC_PREFIX):
        ttable = current.s3db.s3_table
        query = (((ttable.name == tablename) & (ttable.mobile_form == True)) & (ttable.deleted != True))
        row = current.db(query).select(ttable.id, limitby=(0, 1)).first()
        if row:
            return True
    else:
        forms = current.deployment_settings.get_mobile_forms()
        for spec in forms:
            if isinstance(spec, (tuple, list)):
                if ((len(spec) > 1) and (not isinstance(spec[1], dict))):
                    tn = spec[1]
                else:
                    tn = spec[0]
            else:
                tn = spec
            if (tn == tablename):
                return True
    return False
