Just after upgrade from 0.9a1 to 0.9a2...
In catwalk.Browse.join_foreign_key (turbogears/toolbox/catwalk/browse.py:190), a SQLObject.SORelatedJoin column is passed in, and join_foreign_key needs to determine the SQLObject column name of the foreign key in the SQLObject that this column refers to. However, the SORelatedJoin column only has the database version of the foreign key column name, and attempts to reconstruct the SQLObject name of the column as follows:
Current (very bad) patch is to ask the other table for all of its columns to see which one matches the .joinColumn string and use its name.
foreign_key = [ cl.name for cl in column.otherClass.sqlmeta.columnList if cl.dbName == column.joinColumn ][0]
Very ugly. However, I don't see any other facility for reverse mapping dbName to name.
31/Mar/2006:11:03:37 HTTP INFO Page handler: <bound method Browse.index of <turbogears.toolbox.catwalk.browse.Browse object at 0xb6cb1e0c>>
Traceback (most recent call last):
File "/fs/hpcbioprojects/python/lib/python2.4/site-packages/CherryPy-2.2.0rc1-py2.4.egg/cherrypy/_cphttptools.py", line 99, in _run
self.main()
File "/fs/hpcbioprojects/python/lib/python2.4/site-packages/CherryPy-2.2.0rc1-py2.4.egg/cherrypy/_cphttptools.py", line 248, in main
body = page_handler(*virtual_path, **self.params)
File "<string>", line 3, in index
File "/fs/hpcbioprojects/python/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/controllers.py", line 207, in expose
output = database.run_with_transaction(expose._expose,func, accept, allow_json, allow_json_from_config,*args, **kw)
File "/fs/hpcbioprojects/python/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/database.py", line 216, in run_with_transaction
retval = func(*args, **kw)
File "<string>", line 5, in _expose
File "/fs/hpcbioprojects/python/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/controllers.py", line 228, in <lambda>
expose._expose.when(rule)(lambda _func, accept, allow_json, allow_json_from_config,*args,**kw: _execute_func(
File "/fs/hpcbioprojects/python/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/controllers.py", line 246, in _execute_func
output = errorhandling.try_call(func, *args, **kw)
File "/fs/hpcbioprojects/python/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/errorhandling.py", line 59, in try_call
output = func(self, *args, **kw)
File "/fs/hpcbiohomes/nedwards/projects/python/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/toolbox/catwalk/browse.py", line 20, in index
total,rows = self.rows_for_model(object_name,start,page_size,filters)
File "/fs/hpcbiohomes/nedwards/projects/python/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/toolbox/catwalk/browse.py", line 119, in rows_for_model
relations = self.relation_values(object_name,rows)
File "/fs/hpcbiohomes/nedwards/projects/python/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/toolbox/catwalk/browse.py", line 138, in relation_values
where=AND(
File "/fs/hpcbiohomes/nedwards/projects/python/lib/python2.4/site-packages/TurboGears-0.9a2-py2.4.egg/turbogears/toolbox/catwalk/browse.py", line 195, in join_foreign_key
return getattr(column.otherClass.q,foreign_key)
File "/fs/hpcbioprojects/python/lib/python2.4/site-packages/SQLObject-0.7.1dev_r1457-py2.4.egg/sqlobject/sqlbuilder.py", line 362, in getattr
self.soClass.sqlmeta.columns[attr].dbName,