mò /á¸Ec@s±dZdZddd!ZdklZlZlZdklZl Z l Z l Z l Z e dƒZedZd fd „ƒYZhd d <d d <dd <dd  if the value of 'x' is:: Let's do it then the text inserted is: 'Let''s do it' however, if x is ommitted or an empty string, then the value inserted is 'null'. s7$Id: sqlvar.py 40218 2005-11-18 14:39:19Z andreasjung $s$Revision: 1.15 $i iþÿÿÿ(s ParseErrors parse_paramss name_param(sfindssplitsjoinsatoisatofttstrtSQLVarcBs&tZdZd„Zd„ZeZRS(Ntsqlvarc CsÇt|ddddddddƒ}t|ddƒ\}}|djo |}n |i}|||_|_||_|i dƒp t d ‚n|d}t |ƒpt d |d f‚ndS( NtnameRtexprttypetoptionaliRsthe type attribute is requiredtdtvarsinvalid type, %s(sthe type attribute is requiredR( t parse_paramstargstNonet name_paramRRtevaltselft__name__thas_keyt ParseErrorttt valid_type(RR RRR((t4/data/zmath/zope/lib/python/Shared/DC/ZRDB/sqlvar.pyt__init__Gs$      cCs¨|i}|i}|d}y@|i}t|ƒtdƒjo||}n ||ƒ}WnW|i dƒo|dodSnt|ƒtdƒj o‚nt d|‚nX|djodSn|djoœyVt|ƒt jo-|ddjo|d }nt |ƒntt|ƒƒ}Wq¤| o#|i dƒo|dodSnt d |‚q¤Xn1|d joœyVt|ƒt jo-|ddjo|d }nt|ƒntt|ƒƒ}Wq¤| o#|i dƒo|dodSnt d |‚q¤Xnˆt|ttfƒpt|ƒ}n| oA|d jo4|i dƒo|dodSqŒt d |‚n|iddƒ|ƒ}|S(NRRRtnulls#Missing input variable, %stintiÿÿÿÿtLs%Invalid integer value for %stfloats,Invalid floating-point value for %stnbs*Invalid empty string value for %st sql_quote__i(RRRR RRRtmdtvRt ValueErrorR t StringTypetatoiRRtatofRt isinstancetunicodetgetitem(RRRRR RR((RtrenderVs\      # #(Rt __module__RRR%t__call__(((RRDs  :RiRtstringRN(t__doc__t __rcs_id__t __version__tDocumentTemplate.DT_UtilRR R R(tfindtsplittjoinR R!RRt __builtins__RRRR(RRR/RR R*R R.RRR+R!R-R ((Rt?1s %  N