[mod_python] [SPAM] Does the Request object have a member called 'name'?

Alberto Ruiz al at ruiz.ws
Mon Apr 3 18:14:01 EDT 2006

This script used to run fine on a Debian system. This is now on FreeBSD
with modpython 2.7.11.

This is what I'm getting:

!V!:0!!V!:My Property Test!!V!:1234 West!!V!:Orem, UT, 84052!!V!:1!!
V!:!!V!:22!!V!:! Mod_python error: "PythonHandler mod_python.publisher"
Traceback (most recent call last): File
"/usr/local/lib/python2.4/site-packages/mod_python/apache.py", line 193,
in Dispatch result = object(req) File
"/usr/local/lib/python2.4/site-packages/mod_python/publisher.py", line
173, in handler result = apply(object, (), args) File
"/home/elkmeadowsrental/www/elkmeadowsrentals.com/save.py", line 23, in
index exclamation=q.name.find("!") AttributeError: 'NoneType' object has
no attribute 'find'

On the following code:

def index (req,t="",id=""):
	global R; R=req;R.content_type="text/html"
	R.write(" ")
	if USER.auth==1:
		for q in R.form.list:
			if q.name=="res!propertyid":propid=q.value
			if q.name=="res!startdate":ressdate=q.value
			if q.name=="res!enddate":resedate=q.value
			if q.name=="res!customerid":custid=q.value
			if q.name==t+"formkey": 
				if q.value=="": id="0"
				else: id=q.value;
.... more code

The problem is when calling the last line.  It seems that q.name is not
defined.  What's wrong? Is this a member method that is implemented in
newer versions (3.1x)?  How do I implement it in 2.7?  Is the problem
somewhere else?  What's the best way to troubleshoot the problem?

More information about the Mod_python mailing list