[SQLObject] sqlite backend issue

2007-11-08 Thread Dan Pascu
There is an issue in the sqlite backend regarding encoding/decoding. Below is the relevant code from the __init__ method: class SQLiteConnection(DBAPI): [...] def __init__(self, filename, autoCommit=1, **kw): global sqlite global using_sqlite2 if sqlite is None:

Re: [SQLObject] alternateID & StringCol & mysql

2007-11-08 Thread Oleg Broytmann
On Thu, Nov 08, 2007 at 01:20:22PM -0500, David Turner wrote: > On Thu, 2007-11-08 at 21:08 +0300, Oleg Broytmann wrote: > > > 333 for UnicodeCol (1000 bytes / 3 bytes * char) > > > >Why 3 bytes?! > > SQLObject converts Unicode to UTF-8 before sending it to MySQL. So > length should be 1000

Re: [SQLObject] alternateID & StringCol & mysql

2007-11-08 Thread David Turner
On Thu, 2007-11-08 at 21:08 +0300, Oleg Broytmann wrote: > On Thu, Nov 08, 2007 at 06:03:37PM +, jonhattan wrote: > > A workaround could be to set a length of 1000 if no length is specified > > and alternateId is present. > > 1000 for StringCol > >I'd rather raise an exception instead of

Re: [SQLObject] alternateID & StringCol & mysql

2007-11-08 Thread Oleg Broytmann
On Thu, Nov 08, 2007 at 06:03:37PM +, jonhattan wrote: > A workaround could be to set a length of 1000 if no length is specified > and alternateId is present. > 1000 for StringCol I'd rather raise an exception instead of silently imposing a limit where the user clearly says "no limits". Si

Re: [SQLObject] alternateID & StringCol & mysql

2007-11-08 Thread jonhattan
Oleg Broytmann escribió: > On Thu, Nov 08, 2007 at 03:22:20PM +, jonhattan wrote: > >> sqlobject.dberrors.OperationalError: BLOB/TEXT column 'nombre' used in >> key specification without a key length >> >> It fixs adding length to the params. >> >> In postgres it does not complain. >>

Re: [SQLObject] alternateID & StringCol & mysql

2007-11-08 Thread Oleg Broytmann
On Thu, Nov 08, 2007 at 03:22:20PM +, jonhattan wrote: > sqlobject.dberrors.OperationalError: BLOB/TEXT column 'nombre' used in > key specification without a key length > > It fixs adding length to the params. > > In postgres it does not complain. Without looking into the MySQL and Postg

[SQLObject] alternateID & StringCol & mysql

2007-11-08 Thread jonhattan
Hi all, I have a table with: nombre = StringCol(alternateID = True) using mysql, when createTable(), I got this error: sqlobject.dberrors.OperationalError: BLOB/TEXT column 'nombre' used in key specification without a key length It fixs adding length to the params. In postgres it does not com

Re: [SQLObject] I don't get it

2007-11-08 Thread Jaime Wyant
Hi Nicolas! I don't know if this helps much, but I don't have the same problems using sqlobject-0.10. If you can upgrade it may help. This script works fine for me. I think it mimics what you're attempting to do. from sqlobject import * import datetime import sys # Setup the database connecti

Re: [SQLObject] own sql and procedures

2007-11-08 Thread cmho...@gmail.com
Am Mon, 5 Nov 2007 19:46:38 +0300 schrieb Oleg Broytmann <[EMAIL PROTECTED]>: > On Mon, Nov 05, 2007 at 03:25:13PM +0100, [EMAIL PROTECTED] wrote: > > 1) is there a possibiliti' to start my own (complex) sql update > > script. > [skip] > > 2) How can i start procedures from sqlobject. > >con

Re: [SQLObject] own sql and procedures

2007-11-08 Thread cmho...@gmail.com
Am Mon, 5 Nov 2007 18:08:06 +0100 schrieb "Diez B. Roggisch" <[EMAIL PROTECTED]>: > On Monday 05 November 2007 15:25:13 [EMAIL PROTECTED] wrote: > > Hi, > > i have 2 questions. > > > > 1) is there a possibiliti' to start my own (complex) sql update > > script. example > > > > insert into webstats

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] ForeignKey

2007-11-08 Thread Oleg Broytmann
On Wed, Nov 07, 2007 at 11:59:56PM +0100, Nicolas Riedel wrote: > class Worktime(SQLObject): > user = ForeignKey("User") > > This call results in an Error: > wt = Worktime.select(Worktime.q.user==identity.current.user) > " AttributeError: Worktime instance has no attribute 'user' " Foreign

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