[Zope] Processing form data.

Fredrick Rybarczyk - LUB NetLab Fredrick.Rybarczyk@lub.lu.se
Wed, 01 Sep 1999 12:02:15 +0200


Terrel Shumway wrote:

> >3: I will also need to url encode my data. Can Zope handle that / is
> >there a module for it somewhere?
>
> Does the standard python module urllib do what you want?
> http://www.python.org/doc/current/lib/module-urllib.html
>
> >4: Im scetching on a simple python module that implements some of the
> >stuff found in CGI.pm Would that be useful to other Zopers or am I doing
> >somthing already done better by others?
>
> I don't quite understand this question.  Zope *IS* a CGI "script".
> All of the CGI functionality is available. Most of it has higher-level
> support,
> so you don't usually need to do much at the primitive CGI level.

You're quite right, but what I really meant was that I'm writing a module
that offers shorthands for html formatting which I use when I write external
methods. The main advantages with CGI.pm that I'm trying to mimic is that
you can keep your html / dtml and the processing script together. I also
feel that a lot of:
print   "<tag name='blablalbla' etc=...'> " + some.content  + "</tag>"
makes the code real ugly ..so my module allows me to do things like this

def form:
    form = Form("some_action")
    sel  = Select("name")
    form.add_item(sel)

    for item in Defs.My_List:
        sel.add_item(Option(item))

    form.add_item(Input("Name", "Type"))
    form.add_item(Input("Submit", "SUBMIT", [], "OK"))
    return str(form)

If anyone is interested, I can publish it somewhere.
-Fredrick


--
==========================================
Fredrick Rybarczyk
Research Engineer
NetLab, Lund University