From: Markos K. <mk...@gm...> - 2011-01-18 02:34:32
|
There's probably an embarrassingly obvious answer.... I have a class that I have written one way that fails in its joins. call it file1. I wrote another class to do the same thing, and it works. I've done diffs on the segments in question, and I still get an "OperationalError 1054 Column name None does not exist". Could it be the different connection would cause two different results? Thanks, --Markos Here are the files: --------fle 1---------------- DOESN'T WORK from sqlobject import * from components import db from SQLObjectWithFormGlue import SQLObjectWithFormGlue #_connection = db.SQLObjconnect() class Title(SQLObject): class sqlmeta: fromDatabase = True _connection = db.conn() #just returns connection string.... booktitle=UnicodeCol(default=None) books = MultipleJoin('Book') author = RelatedJoin('Author', intermediateTable='author_title',createRelatedTable=True) categorys = MultipleJoin('Category') kind = ForeignKey('Kind') listTheseKeys=('kind') ---file2--------------------- WORKS! from etc import * from sqlobject import * from sqlobject.sqlbuilder import * #Set up db connection connection = connectionForURI('mysql://%s:%s@%s:3306/%s?debug=1&logger=MyLogger&loglevel=debug&use_unicode=1&charset=utf8' % (dbuser,dbpass,dbhost,dbname)) sqlhub.processConnection = connection class Title(SQLObject): class sqlmeta: fromDatabase = True booktitle=UnicodeCol(default=None) books = MultipleJoin('Book') author = RelatedJoin('Author', intermediateTable='author_title',createRelatedTable=True) categorys = MultipleJoin('Category') kind = ForeignKey('Kind') listTheseKeys=('kind') |