[mod_python] Newbie Question

Clodoaldo clodoaldo.pinto.neto at gmail.com
Thu Apr 10 16:37:50 EDT 2008


2008/4/10, mail-lists <mail-lists at peachnet.com>:
> Colin Bean wrote:
>
> > Are you looking for sessions (
> >
> http://modpython.org/live/current/doc-html/pyapi-sess.html
> )?  That's
> > really the only way to persist your object across redirects...
> >
>
>  No, I don't think that's what I want to do.
>
>  I just really want to do the same thing as a form does except on the server
> side ie. I want to set attributes in the FieldStorage class.
>
>  I'm going to hazard a guess here and say that my concept of this is wrong
> and I cannot modify the request object the way I think I can.
>  Maybe I can write out what I'm doing:
>
>  ##############################

  def addcustomer(req, custormer_name):

         html = """A bunch of html that displays among other things the
                   following form:
                     <form action=savecustomer method="get">
                       <input type="text" name="customer_name" value="%s">
                       <input type="submit">"""" % customer_name

         return html


  def savecustomer(req):

         customer_name = req.form.getfirst('customer_name', '')

         valid = myvalidatefunction(customer_name)

         if ! valid:
            addcustomer(req, 'custome_name')


Regards, Clodoaldo


More information about the Mod_python mailing list