;ò ž‚fCc@s_dZdklZlZlZdkZdklZdkl Z l Z de fd„ƒYZ de fd„ƒYZ d e fd „ƒYZd e fd „ƒYZd efd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd „ƒYZd!efd"„ƒYZd#efd$„ƒYZd%efd&„ƒYZd'efd(„ƒYZd)efd*„ƒYZd+efd,„ƒYZd-fd.„ƒYZ d/e efd0„ƒYZ!d1e efd2„ƒYZ"d3e"fd4„ƒYZ#dS(5s$Revision: 1.8 $(sListTypes TupleTypes StringTypeN(sTag(smkDictslogs FormExceptioncBstZRS(N(s__name__s __module__(((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pys FormException"ss FieldMissingcBstZdd„ZRS(Ns is mandatorycCs&||_||_ti||ƒdS(N(sfieldsselfsmessages Exceptions__init__(sselfsfieldsmessage((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pys__init__$s  (s__name__s __module__s__init__(((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pys FieldMissing#ssValidationErrorcBstZd„ZRS(NcCs&||_||_ti||ƒdS(N(sfieldsselfsmessages Exceptions__init__(sselfsfieldsmessage((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pys__init__*s  (s__name__s __module__s__init__(((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysValidationError)ssValidationFailurecBstZd„ZRS(NcCs||_ti|tƒdS(N(serrorssselfs Exceptions__init__smessage(sselfserrors((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pys__init__0s (s__name__s __module__s__init__(((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysValidationFailure/ssFormPartcBs/tZdZdZdZdZdZd„ZRS(Ns formStatesstartserrorsconfirmssubmitcCs&|iƒi|itiƒ}|SdS(N(shandlersscratchsgetsselfs FORMsTATEkEYsFormPartsSTARTsstate(sselfshandlersstate((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysgetStateDs(s__name__s __module__s FORMsTATEkEYsSTARTsINeRRORs INcONFIRMsINsUBMITsgetState(((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysFormPart;s sFormcBsžtZd„Zd„Zd„Zd„Zd„Zdd„Zd„Zd „Z d „Z d „Z dd „Z d „Z d„Zd„Zd„Zd„ZRS(NcCsti|ƒdS(N(sTagsinitsself(sself((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysinitJscCs´||j o£|o t|dƒoˆy#|i|iƒ|iiƒ|(shiddenshtmlsitemssksv(sselfshiddenskshtmlsv((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pys renderHiddenŠs  cCshSdS(N((sselfshandler((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pys getHidden‘scCsN|iidƒ}| o,|iƒiƒ}|iƒt |ƒ}n|SdS(Nsaction( sselfsattrssgetsactionshandlersreqsgetUrlsurlsclearsstr(sselfshandlersactionsurl((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pys getAction•s  cCsš|i|ƒ}|o|id|ƒ}n |iƒ}|i|ƒ}|iƒi dƒ|d<|i |ƒ||i <|i |ƒ}d|||fSdS(Nsactions
%s %s
(sselfs getActionshandlersactions buildAttrss formattrss getHiddenshiddensreqsgetInputsgetStates FORMsTATEkEYs renderHiddensfields(sselfshandlersfieldssactionshiddens formattrs((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pys renderFormžs cCs|i||ƒSdS(N(sselfs renderFormshandlerscdata(sselfshandlerscdata((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pys renderConfirmªscCs|iƒiddƒSdS(Nssubmit.xssubmit(shandlersreqs hasInputs(sselfshandler((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysonSubmit­scCs|iƒiddƒSdS(Ns confirm.xsconfirm(shandlersreqs hasInputs(sselfshandler((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pys onConfirmed°scCs|iƒidƒdSdS(NsGOTO NEXT PAGE(shandlersreqslog(sselfshandlerscdata((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysgoNext³scCs#|iƒi|iƒiƒƒdS(N(shandlersreqslogs getInputs(sselfshandlerscdata((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pyssubmit·scCs(|i||ƒ|i||ƒdSdS(Nsform submitted(sselfssubmitshandlerscdatasgoNext(sselfshandlerscdata((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysdoSubmitºs(s__name__s __module__sinits validatorsvalidates preProcesss prepareDatas__call__s renderHiddens getHiddens getActions renderForms renderConfirmsonSubmits onConfirmedsgoNextssubmitsdoSubmit(((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysFormIs           sFieldcBs’tZdZd„Zd„Zdd„Zd„Zd„Zd„Zd „Z d „Z dd „Z d „Z d „Z d„Zd„Zd„ZRS(NicCs|iƒdSdS(Nsname(sselfsgetAttrs(sself((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysgetNameÃscCs~|iƒiddƒ}t|dƒo|io"|i||i|ƒ|ƒ}n|i ||ƒ}| o|Sn|SdS(Nsvaluessrecord( sselfsgetAttrssgets startvalueshasattrsrecordsfromDbsnameshandlers getFormValuesvalue(sselfshandlersnamesvalues startvalue((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pys getStartValueÆs"scCs|iƒi||ƒSdS(N(shandlersreqsgetInputsnamesdefault(sselfshandlersnamesdefault((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pys getFormValueÏscCs#|o|i||ƒSn|SdS(N(srecordsgetsnames defaultValue(sselfsnamesrecords defaultValue((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysfromDbÒscCsU|iƒ}|i|ƒtijo|i||ƒ}n|i ||ƒ}|SdS(N( sselfsgetNamesnamesgetStateshandlersFormsSTARTs getStartValuesvalues getFormValue(sselfshandlersvaluesname((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysgetValueØs  cCsd|iƒ}|i||ƒ}|ip|iƒidƒo| ot |iƒƒ‚n|SdS(Nsrequired( sselfsgetNamesnames getFormValueshandlersvaluesREQUIREDsgetAttrssgets FieldMissing(sselfshandlersnamesvalue((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysisGivenás  (cCs|i|ƒSdS(N(sselfsisGivenshandler(sselfshandler((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysvalidateéscCs|SdS(N(scdata(sselfshandlerscdata((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pyscDataìscCs |iƒidƒo2|i|ƒ}|i|||i||ƒƒSn|i |ƒt i jo2|i|ƒ}|i |||i||ƒƒSn|i |ƒt i jon|iƒi|dƒ}t|tƒo#|i|||i||ƒƒSq|i |||i||ƒƒSn|i |ƒt ijo;|iƒi|dƒ}|i|||i||ƒƒSn|i|ƒ}|i |||i||ƒƒSdS(Nsreadonlys(sselfsgetAttrssgetsgetValueshandlersvaluesrenderReadOnlyscDatascdatasgetStatesFormsSTARTsrenderEditablesINeRRORsscratchs isinstances FormExceptions renderInErrors INcONFIRM(sselfshandlerscdatasvalue((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pys__call__ïs #####cKsti||�SdS(N(sTags buildAttrssselfskws(sselfshandlerskws((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pys buildAttrsscCs3d|i||i|ƒ|ƒ|iƒ|fSdS(Ns&%s <- %s: %s (sselfsrenderEditableshandlersgetValuescdatasgetNamesvalue(sselfshandlersvaluescdata((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pys renderInError scCsm|o;d|iƒd|i|d|ƒ||iƒdfSn(d|iƒd|i|d|ƒfSdS(Ns<%s %s>%sstagnamesvalues <%s %s />(scdatasselfsgetAttrss buildAttrsshandlersvalue(sselfshandlersvaluescdata((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysrenderEditables;cCs$d||iƒ|i|ƒfSdS(Ns3%s(svaluesselfsgetNamesgetValueshandler(sselfshandlersvaluescdata((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysrenderReadOnlyscCs…d}|iƒ}t|ƒtgƒjo6t|d„|ft|ƒ|ƒ}di |ƒSnd||iƒ|i |ƒfSdS(Ns-%scCs||||fS(N(shsvsn(snsvsh((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysss,s3%s( shtmlsselfsgetNamesnamestypesvaluessmapslensfieldssjoinsgetValueshandler(sselfshandlersvaluesscdatasnamesfieldsshtml((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysrenderReadOnlys  %(s__name__s __module__sREQUIREDsgetNames getStartValues getFormValuesfromDbsgetValuesisGivensvalidatescDatas__call__s buildAttrss renderInErrorsrenderEditablesrenderReadOnly(((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysFieldÁs           s DefaultFieldcBs#tZeZeZdZd„ZRS(NscCsªti|ƒ|io|iƒid|iƒn|iƒidƒ o[|i o9|ii t |i ƒ }|di ƒ|d|_n|i|iƒd(sselfsgetNamesgetValueshandler(sselfshandlersvaluescdata((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysrenderReadOnlyCs(s__name__s __module__sTYPEsEXTsrenderReadOnly(((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysHidden@ssMultiplecBs)tZdZdZdd„Zd„ZRS(NscheckedsvaluescCs|iƒi|ƒSdS(N(shandlersreqs getInputssname(sselfshandlersnamesdefault((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pys getFormValueMscKs´|i|�}|i|ƒ}t|ƒtgƒjo |g}n|iƒi dƒ}|o@||jot ||i cCs||||fS(N(shsvsn(snsvsh((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pys}ss,( shtmlsselfsgetNamesnamestypesvaluessmapslensfieldssjoin(sselfshandlersvaluesscdatasnamesfieldsshtml((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysrenderReadOnlyys  %(s__name__s __module__s getFormValuesrenderEditablesrenderReadOnly(((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysOptionsqs  sSubmitcBs&tZdZdZd„Zd„ZRS(NsSubmitssubmitcKsH|i|ƒtijod|d%s(sselfsgetLabelsvaluesgetNamesgetValueshandler(sselfshandlersvaluescdata((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysrenderReadOnly¬sc Csâ|i}d}xÈ|D]À}t|ƒttfjoPt|ƒ}|djo|\}}}q�|d|ddf\}}}n||df\}}}t |ƒt |ƒjo d}nd||||f}qW|SdS(Nsiiisselecteds#%s(sselfsOPTIONSsoptionss optionListsostypesListTypes TupleTypeslensolensvalueslabelschosensstrsselected( sselfsselectedsvalueschosenslabelsos optionListsolensoptions((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pys getOptionList¯s   $ cCsŒ|iƒidƒ}|tjo |iSn|i|iƒ}t|i d„|ƒ}t |dƒdjott||ƒ}n|SdS(NsoptionscCs |i|ƒS(N(sxssplitsch(sxsch((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysÅsii( sselfsgetAttrssgetsoptionssNonesOPTIONSssplits FIRSTSplitsmaps SECONDSplitslen(sselfsoptions((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pys getOptionsÀs  ( s__name__s __module__sEXTsOPTIONSs FIRSTSplits SECONDSplitsinitsrenderEditablesgetLabelsrenderReadOnlys getOptionLists getOptions(((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysSelect�s    sTextAreacBstZdZd„ZRS(NsTextAreacCs7|i|ƒ}|o |}nti|||ƒSdS(N(sselfsgetValueshandlersvaluescdatas DefaultFieldscData(sselfshandlerscdatasvalue((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pyscDataÎs (s__name__s __module__sEXTscData(((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysTextAreaËssFilecBs\tZdZdZdZdZdZdZd„Zdd „Z d „Z d „Z d „Z RS( NsFilesfiles
current choice: %s ssavedAsssaveds‹%(filename)scCsFti||||iƒ}ti||||iƒ}||fSdS(N( s DefaultFields getStartValuesselfshandlersnamesSAVEDsfilenamesSAVEDASstempname(sselfshandlersnamesfilenamestempname((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pys getStartValueÜsscCsa|iƒi|ƒ}|tjpt|ƒtdƒjo|Sn|iƒ|i |i fSdS(Ns( shandlersreqsgetFilesnamesfilesNonestypesdefaultskeepsfilenamestempname(sselfshandlersnamesdefaultsfile((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pys getFormValueás & cCsŒd}d}|tjpt|ƒtdƒj o;|\}}|iƒid|i ƒ|i ||ƒ}nt i ||||ƒ|SdS(Nss currentlabel(sfilenamescurrentsfilesNonestypestempnamesselfsgetAttrssgets CURRENTLABELsreadOnlys DefaultFieldsrenderEditableshandlerscdata(sselfshandlersfilescdatasfilenamescurrentstempname((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysrenderEditableës ' /cCsW|tjpt|ƒtdƒj o|\}}n d}d}|i||ƒSdS(Ns(sfilesNonestypesfilenamestempnamesselfsreadOnly(sselfshandlersfilescdatasfilenamestempname((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysrenderReadOnlyõs 'c CsJ|iƒ}td||id||id|d|ƒ}|i |SdS(NssavedssavedAssfilenamestempname( sselfsgetNamesnamesmkDictsSAVEDsSAVEDASsfilenamestempnamesattrss READoNLYhTML(sselfsfilenamestempnamesnamesattrs((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysreadOnlyýs /( s__name__s __module__sEXTsTYPEs CURRENTLABELsSAVEDASsSAVEDs READoNLYhTMLs getStartValues getFormValuesrenderEditablesrenderReadOnlysreadOnly(((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysFileÔs  sPasswordEncodercBstZd„Zd„ZRS(NcCs.|d djod|i|ƒSn|SdS(Nisx:(sxsselfscrypt(sselfsx((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysencodescCsti|ƒ}|iƒSdS(N(smd5snewsxseggs hexdigest(sselfsxsegg((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pyscrypt s(s__name__s __module__sencodescrypt(((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysPasswordEncoders s PasswordGroupcBstZd„ZRS(NcCs'|i|ƒ}d|iƒ|fSdS(Ns*(sselfsencodesvaluesgetName(sselfshandlersvaluescdata((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysrenderReadOnlys(s__name__s __module__srenderReadOnly(((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pys PasswordGroup ss PasswordInputcBs,tZdZdZdZd„Zd„ZRS(NspasswordiicCsd|iƒ|fSdS(Ns.****(sselfsgetNamesvalue(sselfshandlersvaluescdata((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysrenderReadOnlyscCszti||ƒ}t|iƒidt|i ƒƒƒ}t |ƒ|jot |i ƒd|ƒ‚n|i|ƒSdS(Nssizes must be %d characters or longer(sInputsvalidatesselfshandlersvaluesintsgetAttrssgetsstrsSIZEssizeslensValidationErrorsgetNamesencode(sselfshandlersvaluessize((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysvalidates '(s__name__s __module__sTYPEsSIZEsREQUIREDsrenderReadOnlysvalidate(((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pys PasswordInputs  sPasswordConfirmInputcBstZd„Zd„ZRS(NcCsti|d||ƒSdS(Nspassword(s PasswordInputsfromDbsselfsrecordsvalue(sselfsnamesrecordsvalue((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysfromDb$scCsg|iti||ƒƒ}|i|iƒidƒƒ}||jot |i ƒdƒ‚n|SdS(Nspasswords8must be the same as what you entered for password( sselfsencodesInputsvalidateshandlersvaluesreqsgetInputspasswdsValidationErrorsgetName(sselfshandlerspasswdsvalue((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysvalidate's  (s__name__s __module__sfromDbsvalidate(((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pysPasswordConfirmInput#s ($s __version__stypessListTypes TupleTypes StringTypesmd5sparsersTagsutilsmkDictslogs Exceptions FormExceptions FieldMissingsValidationErrorsValidationFailuresFormPartsFormsFields DefaultFieldsInputsGroupsReadOnlysHiddensMultiplesCheckBoxsRadiosOptionssSubmitsSelectsTextAreasFilesPasswordEncoders PasswordGroups PasswordInputsPasswordConfirmInput( sCheckBoxsGroups FieldMissingsSubmitsFields DefaultFieldsInputsHiddens StringTypesMultipleslogsForms PasswordGroupsValidationFailuresmkDicts __version__s PasswordInputsValidationErrorsFormPartsPasswordEncodersListTypes TupleTypesOptionssmd5sTextAreasReadOnlysTagsRadiosFilesPasswordConfirmInputs FormExceptionsSelect((s7/home/groups/p/ps/pso/htdocs/tutorial/Lists/pso/form.pys?s8   x`   ; /