I'm a little stumped on this one, though admittedly I'm still learning
to read python stacktraces so it could be something obvious to the
trained eye.

This happens with the latest development version of Django and also
with 0.96.   I have an existing MySQL database and I used 'inspectdb'
to reverse engineer a Django model from it (using MySqlDB 1.2.1-p2).
I cut out everything except for a single table and I'm trying to just
dump everything in the table.

a = Organization.objects.all ()
print a

This produces the following trace:

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/home/joe/code/repo//lib/python/django/db/models/query.py",
line 108, in __repr__
    return repr(self._get_data())
  File "/home/joe/code/repo//lib/python/django/db/models/query.py",
line 482, in _get_data
    self._result_cache = list(self.iterator())
  File "/home/joe/code/repo//lib/python/django/db/models/query.py",
line 189, in iterator
    cursor.execute("SELECT " + (self._distinct and "DISTINCT " or "")
+ ",".join(select) + sql, params)
  File "/home/joe/code/repo//lib/python/django/db/backends/util.py",
line 19, in execute
    return self.cursor.execute(sql, params)
  File "/usr/lib/python2.5/site-packages/MySQLdb/cursors.py", line
159, in execute
    self.errorhandler(self, TypeError, m)
  File "/usr/lib/python2.5/site-packages/MySQLdb/connections.py", line
35, in defaulterrorhandler
    raise errorclass, errorvalue
TypeError: str() takes at most 1 argument (4 given)

I can execute other queries against this model, for example, selecting
with a known key.  I walked through the code, but I couldn't
immediately see where there was a string conversion taking place that
could result in this error.  I'm wondering if this is happening in
native code backing mysqldb?

Anyone give me a nudge in the right direction?

Thanks,
Joe

--~--~---------~--~----~------------~-------~--~----~
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