mò /á¸Ec@sdZdZddd!ZdkZdklZlZlZedZ dk l Z l Z l Z lZlZd klZlZlZd fd „ƒYZhd d <dd <dd <dd  age >= age <= This example illustrates how groups can be nested to control boolean evaluation order. It also illustrates that the grouping facility can also be used with other DTML tags like 'if' tags. The 'sqlgroup' tag checks to see if text to be inserted contains other than whitespace characters. If it does, then it is inserted with the appropriate boolean operator, as indicated by use of an 'and' or 'or' tag, otherwise, no text is inserted. s8$Id: sqltest.py 40218 2005-11-18 14:39:19Z andreasjung $s$Revision: 1.5 $i iþÿÿÿN(s ParseErrors parse_paramss name_paramtstr(sfindssplitsjoinsatoisatof(sListTypes TupleTypes StringTypetSQLTestcBs0tZdZdZZd„Zd„ZeZRS(NtsqltestcCs·t|ddddddddddddd dƒ}t|d dƒ\}}|djo |}n |i}|||_|_||_|i dƒp t d‚n|d|_ }t |ƒpt d |d f‚n|i dƒo|d|_n|i dƒo|d|_n|i dƒo|d|_n6|idjod}t |d f‚n |i|_d}|i d ƒo |d }ti||ƒ}n||_dS(Ntnamettexprttypetcolumntmultipleitoptionaltoptsqlvarsthe type attribute is requiredRsinvalid type, %ss: the column attribute is required if an expression is usedt=(sthe type attribute is requiredR(t parse_paramstargstNonet name_paramRRtevaltselft__name__thas_keyt ParseErrorRttt valid_typeR RRterrR tcomparison_operatorstget(RRRRRRR ((t5/data/zmath/zope/lib/python/Shared/DC/ZRDB/sqltest.pyt__init__Qs8        c Cs—|i}|i}|i}y@|i}t|ƒtdƒjo||}n ||ƒ}WnCt j o7|i dƒo|dodSnt d|‚nXt|ƒt t fjo3t|ƒdjo|i ot d|‚qön |g}g}xŸ|D]—}| o't|ƒtjo|djoqn|djo}yVt|ƒtjo-|dd jo|d }nt|ƒntt|ƒƒ}Wqt j ot d |‚qXnÌ|d jo€| ot|ƒtjoqny7t|ƒtjot|ƒntt|ƒƒ}Wqt j ot d |‚qXn?t|ttfƒpt|ƒ}n|id dƒ|ƒ}|i|ƒqW| oG|djo:|i dƒo|dodSqíd|}t |‚n|p#|iodSnt d|‚nt|ƒdjoRttt|ƒdƒ}|idjod|i |fSq|d|i |fSnd|i |i|dfS(NRR s#Missing input variable, %sis/multiple values are not allowed for %ststringtintiÿÿÿÿtLs%Invalid integer value for %stfloats,Invalid floating-point value for %st sql_quote__itnbs*Invalid empty string value for %ss%No input was provided for %ss, s<>s%s not in (%s)s %s in (%s)s%s %s %s(!RRRRRRRtmdtvtKeyErrorRt ValueErrortListTypet TupleTypetlenRtvst StringTypetatoiRRtatofR t isinstancetunicodetgetitemtappendRR tjointmapR R( RR#R*RRRRRR$((Rtrenderust     (     ( Rt __module__RRR RRR4t__call__(((RRMs   $ MRiR RR"teqR tnes<>tltttges>=tgte(t__doc__t __rcs_id__t __version__tsystDocumentTemplate.DT_UtilRR Rt __builtins__RRtfindtsplitR2R,R-ttypesR'R(R+RRRR(RR+R(R2RGRRRDRBR,RHRR'RCR-RR R((Rt?9s   %w-