[Zope] Newbie Zope/Formulator/Namespace Difficulties:

Sajec, Mike TQO msajec at tqs.com
Thu Oct 16 00:18:14 EDT 2003


Hello,

First off, I'm new to zope and formulator, and am having trouble
understanding how namespaces are passed around.

I would like to use a formulator-form to pass it's parameters to a python
script, which will then call a zsql method.

I created a formulator-form which collects the following data:
orig_lot_id (string)
system	(string)
start_date (datetime)
finish_date (datetime)

The formulator setting "action" is set to my python script pyProcessForm
(see below)

When I submit the form, I get the following error:
Error Type: AttributeError
Error Value: sql_display_recently_tested_lots

Any help is very much appreciated.  Thank you in advance,
Mike

=======================
pyProcessForm 
=======================
from Products.Formulator.Form import FormValidationError

req = context.REQUEST
error = ''
try:
  container.form_query_recent.validate_all_to_request(req)
except FormValidationError, e:
  for i in e.errors:
   title = i.field.get_value('title')
   text = i.error_text
   error = error + '<b>' + title + '</b>' + ' ' + text + '<p>'
   error_html =  "<b>The following errors were found in the form:</b>\
         <p>\
        <blockquote style=\"color: red; font-size: 13px\">" + error +
"</blockquote></p>"
  return error_html
else:
  rec = context.sql_display_recently_tested_lots(part_code =
formulator_field_part_code, 
                                           start_date =
formulator_field_start_date,
                                           finish_date =
formulator_field_finish_date, 
                                           system = formulator_field_system)
  print "fields: ", rec.names(), "\n"
  return printed

===========================================================
sql_get_test_results( part_code, start_date, finish_date, system)  ***This
works***
===========================================================
SELECT 
ft_header.orig_lot_id, 
ft_header.start_date, 
ft_header.finish_date, 
ft_header.system, 
ft_header.serial_hi, 
ft_header.n_pass, 
ft_header.n_fail, 
ft_header.n_sites 
FROM 
ft_header   
WHERE
ft_header.part_code = <dtml-sqlvar part_code type=string>   
AND ft_header.start_date >= <dtml-sqlvar start_date type=string> 
AND ft_header.finish_date <= <dtml-sqlvar finish_date type=string> 
AND ft_header.system = <dtml-sqlvar system type=string>
ORDER BY
ft_header.start_date DESC



More information about the Zope mailing list