[Zope] Still Chipping Away At Formulator/ZPT Interface

beno zope@thewebsons.com
Mon, 04 Nov 2002 19:34:14 -0400


At 10:32 PM 11/4/2002 +0100, you wrote:

>  > >e.g. the equivalent to "<dtml-in> are "for" loops:
>  > >
>  > >  form = context.email_us_formulator
>  > >  for fiels in form.fields():
>  > >    print '<td>' + field.get_value('title') + '</td>'
>  >
>  > Hmmm. This didn't work. It threw an AttributeError on *fields*. Just 
> to be
>  > sure, I changed your line to
>  > for x in form.fields():
>  > and it was the form.fields() that was erroring. Why would it work in DTML
>  > and not in Python?
>
>okok, maybe I should test the code myself or look up the online help
>before I blow a posting to the list. :-/
>
>The proper incantation should be:
>
>   for field in form.get_fields():
>     print '<td>' + field.get_value('title') + '</td>'

Thank you :))

>If You want to fix similar typos Yourself:
>  - go to the Formulator Form in the ZMI:
>  - click "Help!" -> select "Formulator" -> select "APT Reference" -> 
> select "Form"
>  - read the text ;)

I forgot about the ZMI Help :-} But there was no *Form*. Anyway, I was 
looking for how to do something similar to this. In DTML, after making a 
round-trip to Formulator, one can call variables thus:
<dtml-var my_var_from_the_form_that_user_filled_out>
I've tried to research how to do this one myself before asking, but how do 
I do this?
Thanks again,
beno




>  >
>  > >  Scott Burton has written an HowTo which may be helpful either:
>  > >
>  > >http://www.zopelabs.com/cookbook/1032909599
>  >
>  > Yep. Read it many times. Before I ever wrote the list. Some of it's 
> pretty
>  > obtuse. And it's written specifically for password authentication: not my
>  > application.
>  >
>  > >  It is also linked via the Formulator page on zope.org ... looking up
>  > >the resources in the web may even be faster than asking the list ;)
>  >
>  > I try. Really, I do :))
>  > Thanks,
>  > beno
>  >
>  >
>  >
>  > _______________________________________________
>  > Zope maillist  -  Zope@zope.org
>  > 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 )