[Zope3-dev] Re: Zope 3 Newsletter: Issue 10
Jim Fulton
jim at zope.com
Mon Sep 8 07:58:59 EDT 2003
Edward Muller wrote:
> On Sun, 2003-09-07 at 07:40, Jim Fulton wrote:
> [snip]
>
>> > If I could replace the
>>
>>>Python Scripts that massage data with a persistent module, I don't even
>>>know how to address that module in public-space page templates in Zope
>>>3.
>>
>>Well, we need to decide that. Here are some thoughts. There are two basic
>>styles of handling forms posts:
>>
>>1. Post to a template (e.g. ZPT) that calls the necessary Python code.
>> This is my preference.
>>
>>2. Post to a bit of Python code that then calls the template. In this case,
>> the Python code has to have a URL.
>>
>>If we had Zope 2-style "script python", things would work the way they
>>do now, for better or worse.
>>
>>If a form is posted to a template, then you could do the form processing
>>in one or more script tags.
>>
>>If we had content-space modules, I would expect them to be traversable.
>>You'd traverse a module to get at one of it's methods. If you wanted to
>>call a method from a template, you'd use a path expression like:
>>"container/themodulename/thementhodname" or, in a python expression:
>>"python: container[themodulename].themethodname(...)".
>>
>>If the form is posted to the python code, then you'd use a URL like:
>>themodulename/thementhodname
>
> [snip]
>
> Late the the whole thing, but I have to ask, why would you want to 'Post
> to a template' and have all of the validation logic in a <script> tags?
Because it might be simpler in some cases.
> Validation logic can include things like sql calls, calls to remote
> sites, etc.
If the logic is that complex, I woudln't do it in a script
tag. I don't think the people using script tags are going
to be writing logic that complex.
Jim
--
Jim Fulton mailto:jim at zope.com Python Powered!
CTO (703) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org
More information about the Zope3-dev
mailing list