[web2py] MSSQL2Adapter
Hello Rather than storing strings as UTF8 in VARCHAR, I would like to store the strings as NVARCHAR in MSSQL. It appears that is what MSSQL2Adapter is meant to do, but there were errors when I tried to use it. I believe a couple changes in the MSSQLAdapater code could make it work (it seems to work for me). I'm using python 2.7, pyodbc 2.1.8. Eric -if fieldtype == 'string' or fieldtype == 'text' and value[:1]=="'": +if (fieldtype == 'string' or fieldtype == 'text') and value[:1]=="'": -return self.log_execute(a,'utf8') +return self.log_execute(a.decode('utf-8'))
Re: [web2py] Re: MSSQL2Adapter
On Mon, Jun 27, 2011 at 3:41 PM, Massimo Di Pierro wrote: > Your suggested change is in trunk. I am trusting you one this since I > am not a MSSQL user and cannot test it. If anybody else is using > MSSQL2Adaperter, i.e. > > DAL('mssql2://') > > please check that this change does not break your code. > Also, the change to how booleans are stored (from BIT to CHAR(1)) is causing a problem. The values are stored as a '0' or '1' (char, not integer), so in BaseAdapater.parse(), the value of '1' does not parse to True, so every boolean value is shown as False. I don't know whether the fix should be in parse() or represent(). I found a short discussion on booleans here: http://groups.google.com/group/web2py/browse_thread/thread/ab015825bea4edb4?pli=1 Eric
Re: [web2py] Re: validator formatter when validation fails
thanks, it works for me On Mon, Feb 17, 2020 at 9:16 PM Massimo Di Pierro wrote: > > I think this is fixed now. Please give it a try. > > On Monday, 17 February 2020 13:53:34 UTC-8, Eric wrote: >> >> In py4web, when form validation fails on a datetime field, py4web throws and >> exception. >> In the IS_DATETIME validator, when validation fails, validate() returns >> value as string (the original value). >> The form code tries to display the fields properly by calling field's >> validator formatter(). -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/CAEVys%2BQACg3t5dmaqM3xtQ7Q7HN%2BPAxuVHnVXR17XoAW%3DDmcsw%40mail.gmail.com.
Re: [web2py] py4web psycopg2 error
you need to install psycopg2 package pip3 install psycopg2 or pip3 install psycopg2-binary On Tue, Feb 18, 2020 at 7:52 AM Maurice Waka wrote: > > SO I start importing/changing from web2py to py4web. > File > "/home/maurice/.local/lib/python3.6/site-packages/pydal/adapters/base.py", > line 134, in find_driver > "No driver of supported ones %s is available" % str(self.drivers) > RuntimeError: No driver of supported ones ('psycopg2',) is available > -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/CAEVys%2BSe%3DqfgGq4wd6TSaH2Gf2SspvA363XyJtKkAQEqHXh3yA%40mail.gmail.com.
Re: [web2py] Using postgresql with py4web gives error
If you are using ## in the password, that might cause problems for the URL/URI parser since # is part of URL structure. Otherwise, it looks like postgres is not running. On Wed, Feb 19, 2020 at 10:32 AM Maurice Waka wrote: > > db = DAL( "postgres://mauricewaka:b123test##@localhost:5432/mydb") > But got this error: ... > RuntimeError: Failure to connect, tried 5 times: ... > Is the server running on host "localhost" (127.0.0.1) and accepting > TCP/IP connections on port 5432? -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/CAEVys%2BQXMzDM03niqtGHf7RdsEsH6hhuAyTQ_uU4uLub0Zf55A%40mail.gmail.com.