Re: [SQLObject] add custom collation function
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ph...> - 2008-06-25 15:00:54
|
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 more complicated. The idea, if I understand > correctly, is to modify the TableClass with a new connection factory. I > don't kind of understand why I've to do this for one SQLObject in > particular... Should this collation be registered to a db connection ? Yes, but SQLObject doesn't expose low-level DB connection to the user. SQLObject's connection is a high-level object that wraps low-level connection; it creates and destroys low-level connections when it wants, and after an sqlite connection is closed and destroyed it certainly no longer remembers any custom settings. The complex way is needed to override sqlite connection and extend it so it (re)registers aggregates/collations every time SQLObject creates a new low-level DB connection. > Below my attempt to modify the function that you pointed out. Then I > call the function sqlite_collate(MyDBClass) before creating the table > with MyDBClass.createTable(). Looks good. What doesn't work? Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |