This piece of code: <!--#if add_piece--> <!--#in "sql_methods.select.hol_piece_next_id()"--> <!--#call "REQUEST.set('hol_piece_next_id',hol_piece_next_id)"--> <!--#/in--> <!--#call "REQUEST.set('hol_piece_starttimeperiod',_.int(ZopeTime(_.int(hol_piece_stp_year), _.int(hol_piece_stp_month),_.int(hol_piece_stp_day),0,0,0,timezone)))"--> <!--#call "REQUEST.set('hol_piece_endtimeperiod',ZopeTime(hol_piece_etp_year, hol_piece_etp_month,hol_piece_etp_day,0,0,0,timezone))"--> <!--#call "sql_methods.insert.hol_piece(REQUEST)"--> <!--#/if--> Gives me this traceback: <FROM REQUEST> form: hol_piece_title: 'asdfasdf' hol_piece_etp_day: '1' add_piece: 'Add Piece' hol_piece_stp_day: '1' hol_piece_etp_year: '1990' hol_piece_status: '0' hol_piece_etp_month: '1' hol_piece_creator: '1' hol_piece_stp_year: '1990' hol_piece_stp_month: '1' </FROM REQUEST> <!-- Error type: Error value: not all arguments converted --> <!-- Traceback (innermost last): File /home/morphex/Zope/lib/python/ZPublisher/Publish.py, line 878, in publish_module File /home/morphex/Zope/lib/python/ZPublisher/Publish.py, line 590, in publish (Info: /Linoo/system/hol/piece_add) File /home/morphex/Zope/lib/python/OFS/DTMLDocument.py, line 213, in __call__ (Object: piece_add) File /home/morphex/Zope/lib/python/OFS/DTMLDocument.py, line 209, in __call__ (Object: piece_add) File /home/morphex/Zope/lib/python/DocumentTemplate/DT_String.py, line 513, in __call__ (Object: piece_add) File /home/morphex/Zope/lib/python/DocumentTemplate/DT_Util.py, line 266, in eval (Object: REQUEST.set('hol_piece_endtimeperiod',ZopeTime(hol_piece_etp_year, hol_piece_etp_month,hol_piece_etp_day,0,0,0,timezone))) File <string>, line 0, in ? File /home/morphex/Zope/lib/python/OFS/Application.py, line 279, in PrincipiaTime (Object: ApplicationDefaultPermissions) File /home/morphex/Zope/lib/python/DateTime/DateTime.py, line 565, in __init__ TypeError: (see above) --> Grr, I'm gonna smash my computer soon! ;( "Thanks in advance"
One of these calls... "Morten W. Petersen" wrote:
<!--#call "REQUEST.set('hol_piece_starttimeperiod',_.int(ZopeTime(_.int(hol_piece_stp_year), _.int(hol_piece_stp_month),_.int(hol_piece_stp_day),0,0,0,timezone)))"-->
... is not like the other ...
<!--#call "REQUEST.set('hol_piece_endtimeperiod',ZopeTime(hol_piece_etp_year, hol_piece_etp_month,hol_piece_etp_day,0,0,0,timezone))"-->
... and that's why one doesn't work (hint: int)
Evan Simpson wrote:
One of these calls...
"Morten W. Petersen" wrote:
<!--#call "REQUEST.set('hol_piece_starttimeperiod',_.int(ZopeTime(_.int(hol_piece_stp_year), _.int(hol_piece_stp_month),_.int(hol_piece_stp_day),0,0,0,timezone)))"-->
... is not like the other ...
<!--#call "REQUEST.set('hol_piece_endtimeperiod',ZopeTime(hol_piece_etp_year, hol_piece_etp_month,hol_piece_etp_day,0,0,0,timezone))"-->
... and that's why one doesn't work (hint: int)
Hrm. Point being, zope chokes on the first call. =) (Ignore the second one) "Thanks in advance"
"Morten W. Petersen" wrote:
Evan Simpson wrote:
One of these calls...
"Morten W. Petersen" wrote:
<!--#call "REQUEST.set('hol_piece_starttimeperiod',_.int(ZopeTime(_.int(hol_piece_stp_year), _.int(hol_piece_stp_month),_.int(hol_piece_stp_day),0,0,0,timezone)))"-->
... is not like the other ...
<!--#call "REQUEST.set('hol_piece_endtimeperiod',ZopeTime(hol_piece_etp_year, hol_piece_etp_month,hol_piece_etp_day,0,0,0,timezone))"-->
... and that's why one doesn't work (hint: int)
Hrm. Point being, zope chokes on the first call. =) (Ignore the second one)
"Thanks in advance"
It seems there was a bug in the documentation on the DateTime module (DateTime.html) on Zope 1.x. <!--#call "REQUEST.set('hol_piece_starttimeperiod',_.int(ZopeTime(hol_piece_stp_year+'/'+ hol_piece_stp_month+'/'+hol_piece_stp_day+' 0:0:0 '+timezone)))"--> would be the correct way to do things.
participants (2)
-
Evan Simpson -
Morten W. Petersen