This code works, now the variable "true" and "false" are lowercase:
db._adapter.dialect.types['boolean']='TINYINT(1)' db._adapter.dialect.true = 1 db._adapter.dialect.false = 0 Thank you very much! Il giorno martedì 28 agosto 2018 09:33:55 UTC+2, Emilio ha scritto: > > Using this code: > > import copy > > db._adapter.dialect.types = copy.copy(db._adapter.dialect.types) > db._adapter.dialect.types['boolean']='TINYINT(1)' > db._adapter.dialect.TRUE = 1 > db._adapter.dialect.FALSE = 0 > > It doesn't crash but also doesn't apply the change, example error in > executing query: > > /home/emilio/web2py-R-2.17.1/gluon/contrib/pymysql/cursors.py:166: Warning > : (1366, u"Incorrect integer value: 'T' for column 'accetto_termini' at > row 1") > > Emilio > > Il giorno sabato 11 agosto 2018 15:34:16 UTC+2, Anthony ha scritto: >> >> Does it work if you replace db._adapter.types with >> db._adapter.dialect.types (the former is now an @property that points to >> the latter)? >> >> Anthony >> >> On Saturday, August 11, 2018 at 9:19:05 AM UTC-4, Emilio wrote: >>> >>> Hi, >>> I have a website using the old release "web2py-R-2.9.12" and it works >>> relying on this workaround: >>> >>> db._adapter.types = copy.copy(db._adapter.types) >>> db._adapter.types['boolean']='TINYINT(1)' >>> db._adapter.TRUE = 1 >>> db._adapter.FALSE = 0 >>> >>> That I found here: >>> https://groups.google.com/forum/#!topic/web2py/IukqqZF_PPE >>> >>> But in the recent releases (I'm upgrading to the R-2.17.1), it gives >>> this error: >>> >>> [image: Schermata da 2018-08-09 11-37-04.png] >>> It's there anything I can do without rewriting all the table definitions? >>> Thanks >>> >> -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.