From: Oleg B. <ph...@ph...> - 2011-01-19 18:22:27
|
Hi! On Wed, Jan 19, 2011 at 06:18:21PM +0100, fortuna123 Gazeta.pl wrote: > class Person(SQLObject): > ... fname = StringCol() > ... mi = StringCol(length=1, default=None) > ... lname = StringCol() > ... > >>> Person.createTable() > > This create table in base who don't have name but i have base who i create > write this I don't think the table is in a DB without a name. All DB operations require a connection to a DB; either you have a connection or SQLObject complains. > createdb fortuna_bib and i don't know how i create class in this base. Create a connection to that database. There are a few ways to do it in SQLObject: sqlobject.sqlhub.processConnection = connectionForURI('postgres:/fortuna_bib') sqlhub is the global connection that's shared between all SQLObject tables. Or do Person.setConnection('postgres:/fortuna_bib') This sets connection only for the table. And now, when you have the connection to the specific database - call Person.createTable() Oleg. -- Oleg Broytman http://phdru.name/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |