Re: [web2py] Re: Support for BIT(1) as boolean?

2017-09-30 Thread Massimo Di Pierro
I have seen that I am trying to get to the bottom of that. The string "NO_AUTO_CREATE_USER" does not appear in web2py, in dal, nor in rocket. My guess is that the error is caused by mysqldb. Do you agree? On Friday, 15 September 2017 17:40:07 UTC-5, Yan Wong wrote: > > > > On Monday, 11

Re: [web2py] Re: Support for BIT(1) as boolean?

2017-09-22 Thread Alfonso Serra
Yan's example worked. But still there are some quirks with the scheduler using connections for long processes. You are able to change T and F for good editing gluon.packages.dal.dialects.base.py line 36 then use Field(.., type = "boolean") as usual. No adapter change with problems or

Re: [web2py] Re: Support for BIT(1) as boolean?

2017-09-22 Thread Alfonso Serra
Thanks Yan, i will use your example if i cant fix this. I can confirm the problem on Version 2.15.3-stable+timestamp.2017.08.07.12.51.45. This is dal declaration working fine on previous versions db = DAL("mysql://myuser:mypassw@localhost/myapp", pool_size = 10, check_reserved=False, migrate

Re: [web2py] Re: Support for BIT(1) as boolean?

2017-09-15 Thread 'Yan Wong' via web2py-users
The following seems to work, by the way (modified from https://groups.google.com/forum/#!topic/web2py/TZsLnytjqhA) ## allow mysql tinyint from gluon.dal import SQLCustomType boolean = SQLCustomType( type ='boolean', native='TINYINT(1)',

Re: [web2py] Re: Support for BIT(1) as boolean?

2017-09-15 Thread 'Yan Wong' via web2py-users
On Monday, 11 September 2017 00:08:00 UTC+1, Massimo Di Pierro wrote: > > what adapter are you using. What is your URI string (without passwords > please)? > By the way, starting web2py using Rocket now says /usr/local/lib/python2.7/site-packages/pymysql/cursors.py:166: Warning: (3090,

Re: [web2py] Re: Support for BIT(1) as boolean?

2017-09-14 Thread 'Yan Wong' via web2py-users
On Monday, 11 September 2017 00:08:00 UTC+1, Massimo Di Pierro wrote: > > what adapter are you using. What is your URI string (without passwords > please)? > Apologies for the slow reply. Annoyingly, I've found that the solution (without copy) doesn't work at the moment. I'm using the

Re: [web2py] Re: Support for BIT(1) as boolean?

2017-09-11 Thread Alfonso Serra
Hi Massimo. This is the db declaration im using. It works well so far not using copy. Standard MySQL 5.5.24 connection. I have read that using BIT may cause problems on calculations with another fields, so TINYINT(1) (-127, 127) would do for a lack of a better option. db =

Re: [web2py] Re: Support for BIT(1) as boolean?

2017-09-10 Thread Massimo Di Pierro
what adapter are you using. What is your URI string (without passwords please)? On Monday, 4 September 2017 09:53:46 UTC-5, Yan Wong wrote: > > With this code, I now find that with the latest version of web2py > (2.15.4), I get > > File "applications/XXX/models/db.py", line 46, in >

Re: [web2py] Re: Support for BIT(1) as boolean?

2017-09-04 Thread 'Yan Wong' via web2py-users
With this code, I now find that with the latest version of web2py (2.15.4), I get File "applications/XXX/models/db.py", line 46, in db._adapter.types = copy.copy(db._adapter.types) AttributeError: can't set attribute I have deleted the copy.copy line, so that I am modifying the adapter

Re: [web2py] Re: Support for BIT(1) as boolean?

2016-01-12 Thread Alfonso Serra
Excuse me, one last question. Is it really necesary? import copy db._adapter.types = copy.copy(db._adapter.types) or modify the adapter right away will work? It looks like it does, but i dont know if theres any implication by skiping copy. Thanks -- Resources: - http://web2py.com -

[web2py] Re: Support for BIT(1) as boolean?

2016-01-11 Thread Alfonso Serra
Im sorry i just seen Massimo's answer at the post: https://groups.google.com/forum/#!searchin/web2py/boolean$20values/web2py/IukqqZF_PPE/Dehg9dKUT58J import copy db =DAL() db._adapter.types = copy.copy(db._adapter.types) db._adapter.types['boolean']='TINYINT(1)' db._adapter.TRUE = 1

Re: [web2py] Re: Support for BIT(1) as boolean?

2016-01-11 Thread Massimiliano
Eventually take a look here: http://www.web2pyslices.com/slice/show/1611/postgresql-custom-adapter On Mon, Jan 11, 2016 at 5:57 PM, Alfonso Serra wrote: > Im sorry i just seen Massimo's answer at the post: > >

Re: [web2py] Re: Support for BIT(1) as boolean?

2016-01-11 Thread Alfonso Serra
Its weird the application seems to work fine but cant create a select() at the console. The queries in the controllers doesnt fail. This is the db definition: if not request.env.web2py_runtime_gae: db = DAL("mysql://root:@localhost/mydb", pool_size = 10, check_reserved= None, migrate=True)