[mod_python]argument matching for forms

sandor.kopanyi at mailbox.hu sandor.kopanyi at mailbox.hu
Wed Apr 3 09:41:14 EST 2002


A mod_python newbie question about argument matching for forms:
I have a form for user registration, with 13 fields (name,
address, etc.) - I pass them to mod_python for processing.

But: if I don't give default values to the arguments, it fails,
saying 13 parameters expected, 3 got...

Which 3? Why those 3? And why works if I give default values?
If I use the req.form.list to extract the values, works fine.
But the other way is much more elegant...

The code:
def add_customer(addr_postal_code=None, addr_city=None, etc.):

This is not working without those None's.

Environment: RedHat 7.2, Python 1.5.2, mod_python 2.7.6, Apache
1.3.20 (mod_python config is copy-paste from doc).

Related to this, a small config question:
in chapter 3.4 (Tutorial/Publisher Handler Makes it Easy) AddHandler
is used for Apache config, in 6.1 (Standard Handlers/Publisher Handler)
SetHandler. What's the difference?

Best regards,

http://www.mailbox.hu - Mert levelezni kell...

More information about the Mod_python mailing list