Bugs item #1621196, was opened at 2006-12-23 01:48
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1621196&group_id=74338
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Firebird/Interbase
Group: SQLObject release (specify)
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: 0.7.2 bug in creating class fromDatabase
Initial Comment:
example:
--- cut ---
from sqlobject import *
sqlhub.processConnection = connectionForURI('firebird://localhost/wwweva')
class selPeople(SQLObject):
class sqlmeta:
fromDatabase = True
pass
--- end cut ---
result:
--- cut ---
Traceback (most recent call last):
File "test_from_Db.py", line 8, in ?
class selPeople(SQLObject):
File "d:\lang\python\lib\site-packages\SQLObject-0.7.2-py2.4.egg\sqlobject\declarative.py", line 109, in __new__
cls.__classinit__(cls, new_attrs)
File "d:\lang\python\lib\site-packages\SQLObject-0.7.2-py2.4.egg\sqlobject\main.py", line 782, in __classinit__
cls.sqlmeta.addColumnsFromDatabase()
File "d:\lang\python\lib\site-packages\SQLObject-0.7.2-py2.4.egg\sqlobject\main.py", line 427, in addColumnsFromDatabase
for columnDef in conn.columnsFromSchema(sqlmeta.table, soClass):
File "D:\Lang\Python\lib\site-packages\sqlobject-0.7.2-py2.4.egg\sqlobject\firebird\firebirdconnection.py", line 193, in columnsFromSchema
colClass, kw = self.guessClass(t.strip(), flength, fscale)
File "D:\Lang\Python\lib\site-packages\sqlobject-0.7.2-py2.4.egg\sqlobject\firebird\firebirdconnection.py", line 215, in guessClass
return col.StringCol, {'length': flength,
NameError: global name 'col' is not defined
--- end cut ---
FIX for this bug:
file: sqlobject\firebird\firebirdconnection.py modify line 129
from: colClass, kw = self.guessClass(t, flength, fscale)
to: colClass, kw = self.guessClass(t.strip(), flength, fscale)
file: sqlobject\firebird\firebirdconnection.py
insert line 2: import sqlobject.col as col
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=540672&aid=1621196&group_id=74338
|