[SQL-CVS] r3308 - in SQLObject/trunk: docs sqlobject
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
|
From: <sub...@co...> - 2008-03-07 16:15:14
|
Author: phd
Date: 2008-03-07 09:15:08 -0700 (Fri, 07 Mar 2008)
New Revision: 3308
Modified:
SQLObject/trunk/docs/News.txt
SQLObject/trunk/sqlobject/col.py
Log:
Under MySQL, PickleCol no longer used TEXT column types; the smallest
column is now BLOB - it is not possible to create TINYBLOB column.
Modified: SQLObject/trunk/docs/News.txt
===================================================================
--- SQLObject/trunk/docs/News.txt 2008-03-07 16:13:50 UTC (rev 3307)
+++ SQLObject/trunk/docs/News.txt 2008-03-07 16:15:08 UTC (rev 3308)
@@ -83,6 +83,9 @@
* SQLBuilder tablesUsedSet handles sqlrepr'able objects.
+* Under MySQL, PickleCol no longer used TEXT column types; the smallest
+ column is now BLOB - it is not possible to create TINYBLOB column.
+
SQLObject 0.9.5
===============
Modified: SQLObject/trunk/sqlobject/col.py
===================================================================
--- SQLObject/trunk/sqlobject/col.py 2008-03-07 16:13:50 UTC (rev 3307)
+++ SQLObject/trunk/sqlobject/col.py 2008-03-07 16:15:08 UTC (rev 3308)
@@ -1445,6 +1445,14 @@
name=self.name, pickleProtocol=self.pickleProtocol)] + \
super(SOPickleCol, self).createValidators()
+ def _mysqlType(self):
+ length = self.length
+ if length >= 2**24:
+ return "LONGBLOB"
+ if length >= 2**16:
+ return "MEDIUMBLOB"
+ return "BLOB"
+
class PickleCol(BLOBCol):
baseClass = SOPickleCol
|