On Mon, Feb 02, 2009 at 09:55:35PM +0100, Stef Mientki wrote: > I started with SQLObject because in general it's decribed as "easier".
Welcome! > So I started here: > > http://www.sqlobject.org/SQLObject.html > > The first problem is that the first example already contains an error ( > at least that's what I guess) > > connection_string = 'sqlite:' + db_filename > > I think there's a slash missing ? Yes. Thank you! > Now the second problem is, > that I want to start with an existing database: > > So this is my code: > > from sqlobject import * > class Test_Create2 ( SQLObject ) : > class sqlmeta : > print 'piep' > fromDatabase = True > > if __name__ == '__main__': > DataBase_Name = 'D:/Data_Python_25/support/test_vl.db' > sqlhub.processConnection = connectionForURI ( 'sqlite:/' + > DataBase_Name ) > Test_Create2.createTable () > > and this the error I get: > Traceback (most recent call last): [skip] > "No connection has been defined for this thread " > AttributeError: No connection has been defined for this thread or process fromDatabase works at the class creation time and hence requires that the connection is created before the class is being created: sqlhub.processConnection = connectionForURI(...) class Test_Create2(SQLObject): ... Oleg. -- Oleg Broytmann http://phd.pp.ru/ p...@phd.pp.ru Programmers don't die, they just GOSUB without RETURN. ------------------------------------------------------------------------------ Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com _______________________________________________ sqlobject-discuss mailing list sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss