On Thu, Nov 08, 2007 at 12:10:39AM +0100, Petr Jake?? wrote:
> Yes, but AFAIK it is necessary to have generator named GEN_<tablename> for
> each table.

   Thank you for reminding. As I don't know Firebird I didn't look into
firebirdconnection.py. Now I just looked and found its _queryInsertID()
really uses generators. 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):
      pass

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            [EMAIL PROTECTED]
           Programmers don't die, they just GOSUB without RETURN.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
sqlobject-discuss mailing list
sqlobject-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to