Deswegen hab ich mal versucht das kleine Beispiel zu ändern:
Code: Alles auswählen
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sqlobject
connection = sqlobject.connectionForURI('sqlite:/tmp/test.db')
sqlobject.processConnection = connection
class Person(sqlobject.SQLObject):
fname = sqlobject.StringCol()
mi = sqlobject.StringCol(length=1, default=None)
lname = sqlobject.StringCol()
Person.createTable()
Code: Alles auswählen
Traceback (most recent call last):
File "test1.py", line 17, in ?
Person.createTable()
File "/usr/lib/python2.4/site-packages/sqlobject/main.py", line 975, in createTable
cls._connection.createTable(cls)
AttributeError: 'NoneType' object has no attribute 'createTable'
Aber da wird ein "from Connection import conn" gemacht, welches bei mir nicht geht, da Connection nicht existiert?!?!