[web2py] Re: "boolean" type in MySQL: CHAR(1) vs TINYINT(1)

2012-10-01 Thread Massimo Di Pierro
I understand the problem. You can chance the DB type (and you did) but web2py still tries to put an 'F' or a 'T' in there. I modified trunk so that this can be achieved: import copy db =DAL() db._adapter.types = copy.copy(db._adapter.types) db._adapter.types['boolean']='TINYINT(1)' db._adapter.T

[web2py] Re: "boolean" type in MySQL: CHAR(1) vs TINYINT(1)

2012-10-01 Thread MichaelF
I spoke too soon about this fixing the problem. It seems that adding/updating a record with such a field using the admin interface, and using a smartgrid, doesn't do it. I create this table: db.define_table('Test_bool', Field('test_bool', 'boolean')) I also have the following a

[web2py] Re: "boolean" type in MySQL: CHAR(1) vs TINYINT(1)

2012-09-22 Thread MichaelF
Converting to 2.x fixed the problems. On Wednesday, September 19, 2012 12:04:28 PM UTC-6, MichaelF wrote: > > I have come across one bug with this. If I add a record using the admin > interface, I check the 'Is_home_team' checkbox (Is_home_team is defined as > a boolean, of course), yet the reco

[web2py] Re: "boolean" type in MySQL: CHAR(1) vs TINYINT(1)

2012-09-19 Thread MichaelF
I have come across one bug with this. If I add a record using the admin interface, I check the 'Is_home_team' checkbox (Is_home_team is defined as a boolean, of course), yet the record has 0 for that field. Given that, as you might expect then, all records have a 0 for that field. ?? On Monday

[web2py] Re: "boolean" type in MySQL: CHAR(1) vs TINYINT(1)

2012-09-17 Thread MichaelF
Well, that's unfortunate. I've migrated this semi-manually; I had only four 'boolean' fields. Other than that, the suggested fix ( db._adapter.types['boolean']='TINYINT(1)' ) seems to work. On Monday, September 17, 2012 8:42:24 PM UTC-6, Massimo Di Pierro wrote: > > I cannot reproduce this erro

[web2py] Re: "boolean" type in MySQL: CHAR(1) vs TINYINT(1)

2012-09-17 Thread Massimo Di Pierro
I cannot reproduce this error with your code in 2.0.9 and the lines in your traceback do not correspond to the source code I have. I think you may be using an older dal.py On Monday, 17 September 2012 16:43:30 UTC-5, MichaelF wrote: > > Yes; here it is: > > 1. > 2. > 3. > 4. > 5. > 6. > 7. > 8.

[web2py] Re: "boolean" type in MySQL: CHAR(1) vs TINYINT(1)

2012-09-17 Thread MichaelF
Yes; here it is: 1. 2. 3. 4. 5. 6. 7. 8. 9. Traceback (most recent call last): File "gluon/restricted.py", line 205, in restricted File "C:/Program Files (x86)/web2py/applications/NCAA_schedule/models/db.py" , line 165, in

[web2py] Re: "boolean" type in MySQL: CHAR(1) vs TINYINT(1)

2012-09-17 Thread Massimo Di Pierro
Do you have a traceback with more information? On Monday, 17 September 2012 14:23:56 UTC-5, MichaelF wrote: > > Thanks. However, I refer to that field with upper case in all places. Can > you tell me where the lower case 'pending' comes from? The field name has > always been defined as upper cas

[web2py] Re: "boolean" type in MySQL: CHAR(1) vs TINYINT(1)

2012-09-17 Thread MichaelF
Thanks. However, I refer to that field with upper case in all places. Can you tell me where the lower case 'pending' comes from? The field name has always been defined as upper case, and the app has been working up until I made that latest change. So I went into the db and changed the field name

[web2py] Re: "boolean" type in MySQL: CHAR(1) vs TINYINT(1)

2012-09-17 Thread Massimo Di Pierro
Field('Pending' <<< upper case ... 'pending' <<< lower case On Monday, 17 September 2012 11:37:13 UTC-5, MichaelF wrote: > > I did a simple import of 'copy' and that got me by that first problem. But > now I have the following problem: > > db.define_table('Person_certification', >

[web2py] Re: "boolean" type in MySQL: CHAR(1) vs TINYINT(1)

2012-09-17 Thread MichaelF
I did a simple import of 'copy' and that got me by that first problem. But now I have the following problem: db.define_table('Person_certification', Field('Person', db.Person), ... Field('Pending', 'boolean', default = False), ... I get the following error on the

[web2py] Re: "boolean" type in MySQL: CHAR(1) vs TINYINT(1)

2012-09-17 Thread MichaelF
1. What will I need to import to get it to recognize 'copy'? I run the suggested code and get told that 'copy' does not exist. (I'm running 2.5; what do I conditionally import?) 2. Are we doing a copy because all the adapters share the same 'types' object? On Tuesday, August 7, 2012 3:48:35 PM

[web2py] Re: "boolean" type in MySQL: CHAR(1) vs TINYINT(1)

2012-08-07 Thread Massimo Di Pierro
On can always do: db=DAL('mssql://...') db._adapter.types = copy.copy(db._adapter.types) db._adapter.types['boolean']='TINYINT(1)' It should work. Can you please check it? On Tuesday, 7 August 2012 11:56:59 UTC-5, Osman Masood wrote: > > However, web2py maintains the promise of backwards compati

[web2py] Re: "boolean" type in MySQL: CHAR(1) vs TINYINT(1)

2012-08-07 Thread Osman Masood
However, web2py maintains the promise of backwards compatibility. One way is to have a 'tinyint_boolean' datatype for those who want to use tinyints as booleans. But that looks kind of messy and inelegant. An alternative is this: We could add a migration script to /scripts to convert all boole

[web2py] Re: "boolean" type in MySQL: CHAR(1) vs TINYINT(1)

2012-07-12 Thread simon
I have just come across this exact same issue. The web2py adapter converts boolean to char(1) but in MySQL the specification is that boolean is stored as tinyint with 0 and 1. So web2py adapter is incorrect. Not changing it perpetuates the mistake. On Sunday, 6 March 2011 05:14:49 UTC, Kevin