[Zope] Pesky DateTime problem

2000-12-15 Thread Timothy Wilson

Hi everyone,

I would *really* appreciate some advice about a problem with a ZClass I
created. This product is a Job Board that our H.R. department can use to
post openings and the public can view. I began by looking at the very nice
"Build a Searchable Job Board" How-To at
http://www.zope.org/Members/mukhsein/job_board_howto and combined that with
the ZClass approach put forward in the Beehive ZClass documentation.

The problem lies in adding an instance of the job board ZClass at which
point Zope reports an "Invalid Date-Time String". At the risk of providing
too much information, I'm going to include some of the relevant methods and
the traceback. I would love it if someone could spot my error. (Why do I
have this feeling that it's something really simple and that I'm an even
larger moron than my friends and acquaintances assume me to be? :-)

Here the traceback:

!--
Traceback (innermost last):
  File /var/lib/zope/2.2.2/lib/python/ZPublisher/Publish.py, line 222, in
publish_module
  File /var/lib/zope/2.2.2/lib/python/ZPublisher/Publish.py, line 187, in
publish
  File /var/lib/zope/2.2.2/lib/python/Zope/__init__.py, line 221, in
zpublisher_exception_hook
(Object: Traversable)
  File /var/lib/zope/2.2.2/lib/python/ZPublisher/Publish.py, line 171, in
publish
  File /var/lib/zope/2.2.2/lib/python/ZPublisher/mapply.py, line 160, in
mapply
(Object: entry_addProcessor)
  File /var/lib/zope/2.2.2/lib/python/ZPublisher/Publish.py, line 112, in
call_object
(Object: entry_addProcessor)
  File /var/lib/zope/2.2.2/lib/python/OFS/DTMLMethod.py, line 172, in
__call__
(Object: entry_addProcessor)
  File /var/lib/zope/2.2.2/lib/python/DocumentTemplate/DT_String.py, line
528, in __call__
(Object: entry_addProcessor)
  File /var/lib/zope/2.2.2/lib/python/DocumentTemplate/DT_With.py, line 146,
in render
(Object: manage_addProduct['JobBoard'])
  File /var/lib/zope/2.2.2/lib/python/DocumentTemplate/DT_Util.py, line 337,
in eval
(Object: job_board_entry_add(_.None,_, NoRedir=1))
(Info: _)
  File lt;stringgt;, line 0, in ?
  File /var/lib/zope/2.2.2/lib/python/OFS/DTMLMethod.py, line 168, in
__call__
(Object: job_board_entry_add)
  File /var/lib/zope/2.2.2/lib/python/DocumentTemplate/DT_String.py, line
528, in __call__
(Object: job_board_entry_add)
  File /var/lib/zope/2.2.2/lib/python/DocumentTemplate/DT_With.py, line 146,
in render
(Object: job_board_entry.createInObjectManager(REQUEST['jobID'],
REQUEST))
  File /var/lib/zope/2.2.2/lib/python/DocumentTemplate/DT_Util.py, line 337,
in eval
(Object: propertysheets.entry_info.manage_editProperties(REQUEST))
(Info: REQUEST)
  File lt;stringgt;, line 0, in ?
  File /var/lib/zope/2.2.2/lib/python/OFS/PropertySheets.py, line 459, in
manage_editProperties
(Object: Traversable)
  File /var/lib/zope/2.2.2/lib/python/OFS/PropertySheets.py, line 286, in
_updateProperty
(Object: Traversable)
  File /var/lib/zope/2.2.2/lib/python/ZPublisher/Converters.py, line 173, in
field2date
  File /var/lib/zope/2.2.2/lib/python/DateTime/DateTime.py, line 698, in
__init__
Invalid Date-Time String: (see above)

--

Here's the job_board_entry_add method that lives in
Control_Panel/Products/JobBoard/:

HTML
HEADTITLEAdd job_board_entry/TITLE/HEAD
BODY BGCOLOR="#FF" LINK="#99" VLINK="#55"

dtml-with "job_board_entry.createInObjectManager(REQUEST['jobID'],
REQUEST)"
dtml-call "propertysheets.entry_info.manage_editProperties(REQUEST)"
/dtml-with

dtml-if NoRedir
dtml-else
dtml-if DestinationURL

dtml-call "RESPONSE.redirect(DestinationURL+'/manage_workspace')"

dtml-else

dtml-call "RESPONSE.redirect(URL2+'/manage_workspace')"
/dtml-if
/dtml-if
/body/html

Here's the "Add a Job Posting" form that the H.R. people use:

dtml-var standard_html_header

h2Add a Job Board Entry/h2
pThis form will create a new job posting for the online job board. You
don't needed to fill in every 
field on the form. Click on the "Add Entry" button at the bottom of the
screen to add the posting to the database./p

form action="entry_addProcessor"
table border="0"

trthJob ID/th
tdinput type="text" name="new_jobID" size="20"/td
/tr
trthOrganization/th
tdinput type="text" name="new_organization" size="60"/td
/tr
trthPosition/th
tdinput type="text" name="new_position" size="60"/td
/tr
trthDescription/th
tdtextarea
name="new_description:text" rows="10" cols="60" wrap="virtual"/textarea/td
/tr
trthPay Offered/th
tdinput type="text" name="new_pay" size="60"/td
/tr
trthLine of Authority/th
tdinput type="text" name="new_loa" size="60"/td
/tr
trthFunction/th
tdtextarea
name="new_function:text" rows="4" cols="60" wrap="virtual"/textarea/td
/tr
trthQualifications/th
tdtextarea
name="new_qualifications:text" rows="8" cols="60" wrap="virtual"/textarea/td
/tr
tr
td colspan=2
pTo create a bullet list of "duties," type each one in the box below and
press the "ENTER" key 
between each item in the list./p
/td
/tr
trthDuties/th
tdtextarea
name="new_duties:text" rows="10" 

Re: [Zope] Pesky DateTime problem

2000-12-15 Thread seb bacon

 The problem lies in adding an instance of the job board ZClass at which
 point Zope reports an "Invalid Date-Time String".

You might have considered this already, but you're not supplying a 
default date in the DateTime field of the form.  This can cause problems, 
because there's a bug in zope that won't allow null values in DateTime 
properties.  

hth

seb



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Pesky DateTime problem

2000-12-15 Thread Timothy Wilson

On Fri, 15 Dec 2000, seb bacon wrote:

  The problem lies in adding an instance of the job board ZClass at which
  point Zope reports an "Invalid Date-Time String".
 
 You might have considered this already, but you're not supplying a 
 default date in the DateTime field of the form.  This can cause problems, 
 because there's a bug in zope that won't allow null values in DateTime 
 properties.  

I thought that was only a problem when defining the list of properties
initially. I didn't think you had to supply a default when creating actual
instances of the class.

-Tim

--
Tim Wilson  | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.k12.mn.us/ | http://www.zope.org/
W. St. Paul, MN |  | http://slashdot.org/
[EMAIL PROTECTED] |   dtml-var pithy_quote | http://linux.com/


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )