On Nov 8, 2007 10:57 AM, Oleg Broytmann <phd@phd.pp.ru> wrote:
On Thu, Nov 08, 2007 at 12:10:39AM +0100, Petr Jake?? wrote:
It construct the name of the generators using the
name of the table: 'GEN_%s' % table, but it allows the user to override it:

class MyTable(SQLObject):
  class sqlmeta:
     idSequence = "MyGEN"

> I would like to use one generator only for all tables (I would
> like to have every ID in the database unique).

  So you have to add sqlmeta and idSequence to all your tables. If that
idSequence is one for all tables you can create the parent sqlmeta and
inherit that fixed name everywhere:

class gen_sqlmeta:
  idSequence = "MyGEN"

class MyTable(SQLObject):
  class sqlmeta(gen_sqlmeta):
Thanks, it looks promising.

Anyway I thing I have to catch the idSequence which is used as a primary key in the master tabel record (row)  because I need to insert this value to the detail table(s) as foreign key(s). Or am I missing or overlooking something?

Petr Jakes