On Fri, Sep 26, 2003 at 02:13:48AM -0500, Ian Bicking wrote:
| On Thursday, September 25, 2003, at 05:03 PM, Sidnei da Silva wrote:
| >I've just checked in a BoolCol, and later I've figured out that it
| >only works reliably on python 2.3. When I run the tests on python 2.2
| >I get 16 errors on my box, but none on 2.3. Can anyone confirm which
| >one is the target version?
|
| They both are supported. 2.2 is the "gold" Python release, i.e., the
| new lowest common denominator. Of course, 2.3 is the "best" Python
| release, i.e., if you can you should use it.
Is there any reason then for the failures I've seen on 2.2? I can post
the errors here.
| In this case the issue was that type(True) == int for 2.2, but not for
| 2.3. That's easy enough to fix -- basically you don't need
| BoolConverter in 2.2, so you don't install it in that case. BoolCol
| has to be a bit more sophisticated than using a converter. I've added
| a validator that will do the trick.
Amazing! Thanks!
| Unfortunately this has raised a new problem. Booleans are represented
| differently depending on what database you are using. The obvious
| choice for booleans in MySQL is TINYINT. In Postgres BOOLEAN. MySQL
| thus likes 0 and 1. Postgres likes 't' and 'f' or other things, but
| not integers. Annoying. Okay, we could make boolean columns into
| ENUM('t', 'f') in MySQL, but I'm afraid that's dumb. Though not
| actually any less efficient, probably. I don't know.
I think that ENUM is fine for MySQL. I had misread the manual and
understood that there was already support for BOOL, but now I see I
was wrong.
| But really I need to bite the bullet and put in database compatibility
| code into SQLBuilder and Converters.
|
| I've committed some changes to Converters and Col that fix this, and a
| number of other fixes to validation in general. For now MySQL does
| BoolCol with the ENUM.
Great! Thank you very much for this.
--
Sidnei da Silva <si...@pl...>
dreamcatching :: making your dreams come true
http://dreamcatcher.homeunix.org
Sendmail may be safely run set-user-id to root.
-- Eric Allman, "Sendmail Installation Guide"
|