import copydb =DAL()db._adapter.types = copy.copy(db._adapter.types)db._adapter.types['boolean']='TINYINT(1)'db._adapter.TRUE = 1db._adapter.FALSE = 0--
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+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
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
db = DAL("mysql://mysqluser:mypassw@localhost/mydb", pool_size = 10, check_reserved=False, migrate=True)
# db._adapter.types = copy.copy(db._adapter.types)what adapter are you using. What is your URI string (without passwords please)?
Version 2.15.4-stable+timestamp.2017.09.02.04.02.22
Database drivers available: sqlite3, imaplib, pyodbc, pymysql, pg8000
Python 2.7.10 (default, Jul 13 2015, 12:18:59)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pymysql
>>> print pymysql.__version__
0.7.9.None
what adapter are you using. What is your URI string (without passwords please)?
db = DAL("mysql://myuser:mypassw@localhost/myapp", pool_size = 10, check_reserved=False, migrate = True)
# db._adapter.types = copy.copy(db._adapter.types)
db._adapter.types['boolean']='TINYINT(1)'
db._adapter.TRUE = 1
db._adapter.FALSE = 0data = {"user": 1, "visible": True}
db.mytable.insert(**data)
C:\Users\User\Desktop\myapp\gluon\contrib\pymysql\cursors.py:166: Warning: (13
66, u"Incorrect integer value: 'T' for column 'visible' at row 1")
result = self._query(query)
C:\Users\User\Desktop\myapp\gluon\contrib\pymysql\cursors.py:166: Warning: (13
66, u"Incorrect integer value: 'T' for column 'configurable' at row 1")
result = self._query(query)
6L