def qsinger(): for f in ['lang', 'gender']: qval = request.GET.get( f , '').strip() if qval: break singers = systemdb.qsingers( f, qval) if len(singers)==0: return 'Error: not found' #raise HTTPError(code=403) return json.dumps( singers, True, False, indent=4)
def func( self, d): gs=['M', 'F'] singers = systemdb.qsingers( 'gender', gs[d]) return { 'rtype':'singer', 'rdata':singers}