[SQLObject] problem: implementing BoolCol
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Bud P. B. <bu...@si...> - 2003-04-14 15:54:54
|
Ian and all, I tried to implement BoolCol and have the following problem: The function sqlRepr in SQLBuilder.py should cast boolean values to either 't' or 'f' (or some alternative reps). Problem is that (in Python 2.2 that I use), there is no Boolean type and sqlRepr has only the python type of the (value) object and knows nothing about the related ColType (SQL type). So I can't figure out how to recognize that I deal with a boolean in sqlRepr... Would it be worth while to refactor sqlRepr to get a second argument that specifies the desired SQL type? cheers --b /----------------------------------------------------------------- | Bud P. Bruegger, Ph.D. | Sistema (www.sistema.it) | Via U. Bassi, 54 | 58100 Grosseto, Italy | +39-0564-411682 (voice and fax) \----------------------------------------------------------------- |