[mod_python] servlet form against publisher

Manera, Villiam vmanera at manord.com
Wed Sep 1 17:42:38 EDT 2004

I'm moving from publisher to servlet, because servlet are wonderful,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

but I'm get used at the publischer way to retrieve fields from a from.


Difference in retrieve fields from Form between publisher and servlet:


In publischer : req.form = util.FieldStorage(req, keep_blank_values=1)

In servlet : self.form = util.FieldStorage(self.req)       # the default for keep_blank_values is 0


So in servlet the fields not filled are not inserted in  self.form.list


Why this choice??


For example:

form with 2 fields: F1 and F2 

if I put 1 in F1 end 2 in F2 

and I would save automatically in self.session F1 and F2

after the submit F1= 1 and F2= 2


If I repeat the submit with F1=1 and F2=None, 

after the new submit still F1=1 and F2=2


because F2 isn't in the list and the last saved F2 in self.session is retrieved.


Is possible to put a class variable in servlet  for customize this choice? 

Villiam Manera 
Dirett.  Sistema Informativo 

Manifatture del Nord srl 
via Mazzacurati 6

42100 Reggio Emilia RE 

Tel. +39 0522 358200 
Fax +39 0522 268700 
email : vmanera at manord.com 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://modpython.org/pipermail/mod_python/attachments/20040901/f6428cf8/attachment-0001.html

More information about the Mod_python mailing list