async def get_channels(ns): sql = "select * from iptvchannels where 1=1 " if ns.get('search_string') and ns['search_string'] != "": search_string = ns.get('search_string') sql = "%s and tv_name like '%%%%%s%%%%'" % (sql, search_string) rec = await runSQLPaging('iptvdb',sql,ns=ns) return rec ns = await request2ns() print('ns=',ns) ns['sort'] = 'tv_name' if not ns.get('page'): ns['page'] = 1 if not ns.get('userid'): ns['userid'] = 'Anoumous' ret = await get_channels(ns) return ret