Re: [SQLObject] how to get generator number

2007-11-08 Thread Petr Jakeš
On Nov 8, 2007 11:33 AM, Oleg Broytmann <[EMAIL PROTECTED]> wrote: > On Thu, Nov 08, 2007 at 11:29:01AM +0100, Petr Jake?? wrote: > > 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 >

Re: [SQLObject] how to get generator number

2007-11-08 Thread Oleg Broytmann
On Thu, Nov 08, 2007 at 11:29:01AM +0100, Petr Jake?? wrote: > 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?

Re: [SQLObject] how to get generator number

2007-11-08 Thread Petr Jakeš
On Nov 8, 2007 10:57 AM, Oleg Broytmann <[EMAIL PROTECTED]> 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): > cl

Re: [SQLObject] how to get generator number

2007-11-08 Thread Oleg Broytmann
On Thu, Nov 08, 2007 at 12:10:39AM +0100, Petr Jake?? wrote: > Yes, but AFAIK it is necessary to have generator named GEN_ 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 g

Re: [SQLObject] how to get generator number

2007-11-07 Thread Petr Jakeš
On Nov 7, 2007 11:53 PM, Oleg Broytmann <[EMAIL PROTECTED]> wrote: > On Wed, Nov 07, 2007 at 11:51:04PM +0100, Petr Jake?? wrote: > > I just wondered if there is a method within the SQLObject to do this > job. > > There is, but it is rather complex. You have to create your own > connection class

Re: [SQLObject] how to get generator number

2007-11-07 Thread Oleg Broytmann
On Wed, Nov 07, 2007 at 11:51:04PM +0100, Petr Jake?? wrote: > I just wondered if there is a method within the SQLObject to do this job. There is, but it is rather complex. You have to create your own connection class whose _queryInsertID() will do the job internally. Oleg. -- Oleg Broyt

Re: [SQLObject] how to get generator number

2007-11-07 Thread Petr Jakeš
> > > I would like to use IDs generated by generator in my application. > > SQLObject either allows the user to generate an ID (outside of > SQLObject) or delegates the job of generating an ID to the connection. If > you want to generate an ID at the backend and pass it to INSERT queries > you >

Re: [SQLObject] how to get generator number

2007-11-07 Thread Oleg Broytmann
On Wed, Nov 07, 2007 at 11:30:13PM +0100, Petr Jake?? wrote: > I would like to use IDs generated by generator in my application. SQLObject either allows the user to generate an ID (outside of SQLObject) or delegates the job of generating an ID to the connection. If you want to generate an ID at