On Feb 5, 2008 11:14 PM, Petr JakeŇ° <petr.jakes@tpc.cz> wrote:
On Feb 5, 2008 11:05 PM, Oleg Broytmann <phd@phd.pp.ru> wrote:
On Wed, Feb 06, 2008 at 12:57:08AM +0300, Oleg Broytmann wrote:
> class MyTable(SQLObject):
>    _connection = connection
>
> class MyTable2(SQLObject):
>    _connection = connection2

  BTW, both _connection and the parameter to .setConnection() can be a DB
URI string - SQLObject calls connectionForURI() itself.


it looks it is necessary first to call:
connection2 = connectionForURI('sqlite:///work/mincovnik.db')
and than:
class MyTable2(SQLObject):
    ......

MyTable2.createTable(ifNotExists=True, connection=connection2)

If I do only:
class MyTable2(SQLObject):
    _connection = 'sqlite:///work/mincovnik.db'
    .......

MyTable2.createTable(ifNotExists=True)

or:
connection2 = connectionForURI('sqlite:///work/mincovnik.db')
class MyTable2(SQLObject):
    _connection = connection2
    .....

MyTable2.createTable(ifNotExists=True)

than the db file '/work/mincovnik.db' is not created 

Petr