[Zope] Close But No Cigar (Formulator/ZPT)

beno zope@thewebsons.com
Tue, 05 Nov 2002 13:49:40 -0400


Hi (again);
Okay, in DTML, when one calls a Formulator form via a DTML document, the 
DTML document to which one sends the POST is able to render variables from 
the form thus:
<dtml-var my_variable_from_the_form>
Now, I'm trying to do this via a Python script (which I promise I will 
furnish for other dummies like me via a HowTo):

form = context.email_us_formulator
i = 0
myField = []
for field in form.get_fields():
   myField.append(field.get_value('title'))
   WHAT DO I DO HERE??
   i = i + 1

try:
     mailhost=getattr(context, context.superValues('Mail Host')[0].id)
except:
     raise AttributeError, "cant find a Mail Host object"

mTo = 'beno@thewebsons.com'
mFrom = YourEmail
mSubj = 'subject'
message = "Hi, Mike! You've just been sent an email from your Web site!\n\n"
message += "Sender's name: " + YourName + "\n"
message += "Sender's phone: " + YourPhone + "\n"
message += "Sender's email: " + YourEmail + "\n\n"
message += "Sender's comments: " + YourMessage + "\n"
mMsg = message

mailhost.send(mMsg, mto=mTo, mfrom=mFrom, subject=mSubj)

where the *WHAT DO I DO HERE??* needs to call the values from the form. (I 
may be mistaken with the line above that, too.) Can you help me?
TIA,
beno