[mod_python] servlet form against publishe rR: Mod_python Digest, Vol 18, Issue 13

Manera, Villiam vmanera at manord.com
Wed Sep 8 12:00:11 EDT 2004


>Daniel Popowich wrote:

>I still don't quite understand why you would need it.  Let's say a
>request comes in like this:

>   http://myserver/myservlet?foo=

>In the current system, if I set query_vars like this:

>   query_vars = ['foo']

>then you get exactly what you need: empty values are stripped by
>FieldStorage, but Servlet, not seeing the key, will set the instance
>variable foo to its default, an empty string.

>Daniel Popowich

Yes, this is right and powerful for new programs, I will develop.

I'm thinking a way to move the 1000 programs that have been  written already from  publisher to servlet, probably I'm the only in the world with this need.

I've written something like servlet.__load_vars but instead to setattr(self, name, val) I put them in session[name] = val and the programs will search there.

In order to set query_vars I should enter inside the 1000  programs to discover the variables to set.

If I had the option to set for these kind of programs req.form = util.FieldStorage(req, keep_blank_values=1) in self.form.list I would find all this variables without looking inside the programs.

So I now understand that it is a special need concerning the past instead of the future, and  I may solve it in a other way,  so don't care anymore about it

Villiam



More information about the Mod_python mailing list