hello, can someone tell me why i'm getting this error/how to avoid it?

here's my code:

----tablestest.py---
from sqlobject import *
class Houses(SQLObject):
  pass
class Bathrooms(SQLObject):
  house = ForeignKey("Houses")
  index1 = DatabaseIndex(house)

----the file i invoke---
from sqlobject import *
from connectstr import connectstr
connection = connectionForURI(connectstr)
sqlhub.processConnection = connection
import tablestest
for name in dir(tablestest):
  obj = getattr(tablestest, name)
  if hasattr(obj, "createTable"):
    print obj
    obj.createTable()

---the error---
<class 'tablestest.Bathrooms'>
Traceback (most recent call last):
  File "E:\MERCUR~1\maketablestest.py", line 15, in <module>
    obj.createTable()
  File 
"d:\Python25\lib\site-packages\sqlobject-0.11dev_r3611-py2.5.egg\sqlobject\main.py",
line 1399, in createTable
    conn.query(constraint)
  File 
"d:\Python25\lib\site-packages\sqlobject-0.11dev_r3611-py2.5.egg\sqlobject\dbconnection.py",
line 346, in query
    return self._runWithConnection(self._query, s)
  File 
"d:\Python25\lib\site-packages\sqlobject-0.11dev_r3611-py2.5.egg\sqlobject\dbconnection.py",
line 259, in _runWithConnection
    val = meth(conn, *args)
  File 
"d:\Python25\lib\site-packages\sqlobject-0.11dev_r3611-py2.5.egg\sqlobject\dbconnection.py",
line 343, in _query
    self._executeRetry(conn, conn.cursor(), s)
  File 
"d:\Python25\lib\site-packages\sqlobject-0.11dev_r3611-py2.5.egg\sqlobject\mysql\mysqlconnection.py",
line 117, in _executeRetry
    raise OperationalError(ErrorMessage(e))
sqlobject.dberrors.OperationalError: Can't create table
'.\ml\#sql-ac_a6.frm' (errno: 150)

I noticed that if I change the names of Houses and Bathrooms to A and
B, I don't get the error.
i'm using MySQL 5.0 and SQLObject 0.11.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to