[Zope] GET vs. POST

Jason Earl jason.earl@simplot.com
12 May 2003 09:38:48 -0600


"David Hassalevris" <bluepaul@earthlink.net> writes:

> Dennis,
> 
> A good while ago Jim Penny posted a message that described a really
> interesting coding
> construct.  One of it benefits is that the URL always stays the same.
> 
>  I never thanked Jim for posting the original msg but I've put this
> technique to good use!
> 
> The idea is the you turn your INDEX_HTML into something of an infinite loop.
> 
> If is filled with statements like:
> 
> <DTML-IF current_state = 'MAIN' and action = 'VENDORS'>
>   <dtml-var vendorsForm>
> <DTML-IF current_state = 'MAIN' and action = 'EMPLOYEES'>
>   <dtml-var employeesForm>
> 
> Anyway, you can find original article at
> 
> http://zope.nipltd.com/public/lists/zope-archive.nsf/47ba74c812dbc5dd8025687
> f0024bb5f/91d6497a4b1c5ade802569dd005d5881?OpenDocument
> 
> David

I personally find that this sort of stuff is almost always clearer
when it is expressed in Python instead of DTML.  Most of my index_html
files are actually Pythonscripts that look something like this:

req = container.REQUEST

if req.has_key('some_flag'):
        return container.some_form()
elif req.has_key('some_other_flag'):
        return container.some_other_form()
else:
        return container.main_form()