Re: [SQLObject] add custom collation function

2008-06-25 Thread Oleg Broytmann
On Wed, Jun 25, 2008 at 04:56:01PM +0200, Pietro Abate wrote: > conn = sql.connectionForURI(uri) > > if conn.dbName == 'sqlite': > from sqlobject.sqlite.sqliteconnection import SQLiteConnection > conn = SQLiteConnection( > > but I don't kind of understand what I should do

Re: [SQLObject] add custom collation function

2008-06-25 Thread Oleg Broytmann
On Wed, Jun 25, 2008 at 04:33:04PM +0200, Pietro Abate wrote: > reg. the StringCol(customSQLType='VARCHAR (255) COLLATE debian') > I think I want sqlType instead as customSQLType is not a parameter > of the class StringCol. Yes, my fault, sorry for the confusion. > The other problem is a bit m

Re: [SQLObject] add custom collation function

2008-06-25 Thread Pietro Abate
Actually I think it's easier ... conn = sql.connectionForURI(uri) if conn.dbName == 'sqlite': from sqlobject.sqlite.sqliteconnection import SQLiteConnection conn = SQLiteConnection( filename=conn.filename, name=conn.name, debug=conn.debug, debugOutp

Re: [SQLObject] add custom collation function

2008-06-25 Thread Pietro Abate
Hi again. Oleg, Thank you for your prompt answer. reg. the StringCol(customSQLType='VARCHAR (255) COLLATE debian') I think I want sqlType instead as customSQLType is not a parameter of the class StringCol. The other problem is a bit more complicated. The idea, if I understand correctly, is to mod

Re: [SQLObject] add custom collation function

2008-06-25 Thread Oleg Broytmann
On Wed, Jun 25, 2008 at 02:19:13PM +0200, Pietro Abate wrote: > if conn.dbName == 'sqlite': > conn.getConnection().create_collation("debian", mycollate) > > where mycollate is a simple comparison function. I'm still not sure if this > is possible or not... I think it's possible but

[SQLObject] add custom collation function

2008-06-25 Thread Pietro Abate
Hi all, I've encountered problem to add a (sqlite) collation function to my tables using sqlobject. Introduction + questions at the bottom. Using plain sqlite you can add a collation function as follows: -- import sqlite3 def collate_reverse(string1, string2): return -cmp(string1, st