[Zope] Zope Date format conversion problem(with empty field)
K. Praveen Kumar
praveen at softprosys.com
Tue Oct 14 08:27:08 EDT 2003
HI All,
When I try it it is working fine but While updating it is giving
error. If some of my date fields are NULL and try to update the values
then it is giving the following ERROR:
Error Type: Invalid Date-Time String
Error Value:
Location:
My Scripts are:
Front:
<input type="text" name="date1:date" size="15" value="<dtml-if
"Child_Enrollment_Date==_.None"><dtml-var Child_Enrollment_Date
null=""><dtml-else><dtml-call
"REQUEST.set('Child_Enrollment_Date1',Child_Enrollment_Date.strftime('%m/%d/%Y'))"><dtml-var Child_Enrollment_Date1 null=""></dtml-if>">
<input type="text" name="date2:date" size="15" value="<dtml-if
"Child_Enrollment_Date==_.None"><dtml-var Child_Enrollment_Date
null=""><dtml-else><dtml-call
"REQUEST.set('Child_Enrollment_Date1',Child_Enrollment_Date.strftime('%m/%d/%Y'))"><dtml-var Child_Enrollment_Date1 null=""></dtml-if>">
Back:
<dtml-call "REQUEST.set('date1',date1.strftime('%Y/%m/%d'))">
<dtml-if "date2==''">
<dtml-call "REQUEST.set('date2',_.None)">
<dtml-else>
<dtml-call "REQUEST.set('date2',date2.strftime('%Y/%m/%d'))">
</dtml-if>
Where I am filling date1 field and not filling date2 field. While
submitting the form It is giving the above error. How can I rectify
this. How can I validate if date field is not filled then how can I
submit that? Any suggestions will be greatly appreciated.
Thanks & Regards
Praveen
On Thu, 2003-10-09 at 19:33, Chris Withers wrote:
> K. Praveen Kumar wrote:
>
> > <dtml-var la_header>
>
> well, you're using DTML which is pretty silly, should be using ZPT for
> presentation...
>
> > <form name="data" ACTION="test_back" METHOD="POST">
> > <input type="text" name="date2" size="15" value="">
>
> try changing that to:
>
> <input type="text" name="date2:date" size="15" value="">
>
> > test_back:
> >
> > <dtml-if "submit=='update'">
> >
> > <dtml-if "date2==_.None">
> > <dtml-var date2 null="">
> > <dtml-else>
> > <dtml-call "REQUEST.set('date2',date2.strftime('%Y/%m/%d'))">
> > <dtml-var date2 null="">
> > </dtml-if>
> >
> > </dtml-if>
>
> This lot should really be a python script...
>
> Chris
-----------------------SOFTPRO DISCLAIMER------------------------------
Information contained in this E-MAIL and any attachments are
confidential being proprietary to SOFTPRO SYSTEMS is 'privileged'
and 'confidential'.
If you are not an intended or authorised recipient of this E-MAIL or
have received it in error, You are notified that any use, copying or
dissemination of the information contained in this E-MAIL in any
manner whatsoever is strictly prohibited. Please delete it immediately
and notify the sender by E-MAIL.
In such a case reading, reproducing, printing or further dissemination
of this E-MAIL is strictly prohibited and may be unlawful.
SOFTPRO SYSYTEMS does not REPRESENT or WARRANT that an attachment
hereto is free from computer viruses or other defects.
The opinions expressed in this E-MAIL and any ATTACHEMENTS may be
those of the author and are not necessarily those of SOFTPRO SYSTEMS.
------------------------------------------------------------------------
More information about the Zope
mailing list