Hi,

I have a simple piece of code that works fine on mod_python and that
breaks on mod_WSGI. Here's the code:

        from django.db import connection
        cursor = connection.cursor()

        cursor.execute(self.sql)
        rows = cursor.fetchall()
        field_names = [field[0] for field in
cursor.cursor.description]

When running on mod_WSGI, this breaks and I get the following error:
AttributeError: 'Cursor' object has no attribute 'cursor'

Do you know how I can get around that?

Thanks a lot,

Julien

PS, the traceback:

<WSGIRequest
GET:<QueryDict: {}>,
POST:<QueryDict: {}>,
COOKIES:{'__utma':
'116064606.728969942518750100.1211981433.1213136535.1213785477.14',
 '__utmb': '116064606.1.10.1213785477',
 '__utmc': '116064606',
 '__utmz': '116064606.1211981433.1.1.utmcsr=(direct)|utmccn=(direct)|
utmcmd=(none)',
 'sessionid': 'a0602931b500e146b7b4cb920fec123e'},
META:{'DOCUMENT_ROOT': '/etc/httpd/htdocs',
 'GATEWAY_INTERFACE': 'CGI/1.1',
 'HTTP_ACCEPT': 'text/html,application/xhtml+xml,application/
xml;q=0.9,*/*;q=0.8',
 'HTTP_ACCEPT_CHARSET': 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
 'HTTP_ACCEPT_ENCODING': 'gzip,deflate',
 'HTTP_ACCEPT_LANGUAGE': 'en-au,en-us;q=0.7,en;q=0.3',
 'HTTP_CACHE_CONTROL': 'max-age=259200',
 'HTTP_COOKIE': '__utmz=116064606.1211981433.1.1.utmcsr=(direct)|
utmccn=(direct)|utmcmd=(none);
__utma=116064606.728969942518750100.1211981433.1213136535.1213785477.14;
sessionid=a0602931b500e146b7b4cb920fec123e;
__utmb=116064606.1.10.1213785477; __utmc=116064606',
 'HTTP_HOST': 'BLABLABLA',
 'HTTP_IF_MODIFIED_SINCE': 'Wed, 18 Jun 2008 10:40:35 GMT',
 'HTTP_IF_NONE_MATCH': '"f1e4ffff8404fe40e235a47afe70c4cb"',
 'HTTP_MAX_FORWARDS': '10',
 'HTTP_REFERER': 'http://BLABLABLA/',
 'HTTP_USER_AGENT': 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB;
rv:1.9) Gecko/2008052906 Firefox/3.0',
 'HTTP_VIA': '1.1 webproxy02.syd.optusnet.com.au:80 (squid/
2.5.STABLE6)',
 'HTTP_X_FORWARDED_FOR': '58.106.1.152, 211.29.137.29',
 'HTTP_X_FORWARDED_HOST': 'BLABLABLA',
 'HTTP_X_FORWARDED_SERVER': 'BLABLABLA',
 'PATH': '/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/X11R6/
bin:/BLABLABLA',
 'PATH_INFO': '/admin/sqlexecuter/query/6/execute/',
 'PATH_TRANSLATED': 'BLABLABLA',
 'QUERY_STRING': '',
 'REMOTE_ADDR': '58.106.1.152',
 'REMOTE_PORT': '37442',
 'REQUEST_METHOD': 'GET',
 'REQUEST_URI': 'BLABLABLA',
 'SCRIPT_FILENAME': 'BLABLABLA.wsgi',
 'SCRIPT_NAME': '',
 'SERVER_ADDR': '127.0.0.1',
 'SERVER_ADMIN': 'BLABLABLA',
 'SERVER_NAME': 'BLABLABLA',
 'SERVER_PORT': '7064',
 'SERVER_PROTOCOL': 'HTTP/1.1',
 'SERVER_SIGNATURE': '',
 'SERVER_SOFTWARE': 'Apache/2.0.52 (Red Hat) mod_wsgi/2.0 Python/2.5',
 'mod_wsgi.application_group': 'BLABLABLA|',
 'mod_wsgi.callable_object': 'application',
 'mod_wsgi.listener_host': '::',
 'mod_wsgi.listener_port': '7064',
 'mod_wsgi.process_group': '',
 'mod_wsgi.reload_mechanism': '0',
 'mod_wsgi.script_reloading': '1',
 'wsgi.errors': <mod_wsgi.Log object at 0xb7f7ec68>,
 'wsgi.file_wrapper': <built-in method file_wrapper of
mod_wsgi.Adapter object at 0xb7c8f1e0>,
 'wsgi.input': <mod_wsgi.Input object at 0xb79ebd68>,
 'wsgi.multiprocess': True,
 'wsgi.multithread': False,
 'wsgi.run_once': False,
 'wsgi.url_scheme': 'http',
 'wsgi.version': (1, 0)}>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to