[web2py] Re: decremental subtraction of values in DB field

2019-01-23 Thread Anthony
> > db.fuelLogging._before_update.append(fuelLogging_before_update()) > It's a callback function, so you should not be calling it yourself. Just append the function (without calling): db.fuelLogging._before_update.append(fuelLogging_before_update) Anthony -- Resources: - http://web2py.com -

[web2py] adding fields dynamically in web2y forms

2019-01-23 Thread mostwanted
I have a little invoice page in my app, but i also want people to be able to invoice as many things as possible at once without having to keep saving so many times, this is what i used: *MODEL* db.define_table("invoice", Field("product", "list:string"),

Re: [web2py] Error: prepared statement «pg8000_statement_0» already exists

2019-01-23 Thread Massimiliano
When psycopg is available web2py will use it when is not it use pg8000 that was included in web2py Il giorno mer 23 gen 2019 alle 14:05 Lisandro ha scritto: > Thank you all for that notes. > > When I run web2py at my server, I see this available drivers: sqlite3, > imaplib, pymysql, pg8000 > I

Re: [web2py] standalone templates

2019-01-23 Thread sandeep patel
@ Carlos I think you can use the current app modules folder. This executes all the .py files on the top label of every request For more information here Thanks SP On Wed, Jan

Re: [web2py] Error: prepared statement «pg8000_statement_0» already exists

2019-01-23 Thread Lisandro
Thanks Massimiliano. Apparently psycopg2 is already installed (of course it was already installed, maybe something broke during the packages upgrade). Something weird is that I see psycopg2 installed twice, is this correct? ~$ pip freeze | grep psycopg2 psycopg2==2.7.5 psycopg2-binary==2.7.5

Re: [web2py] Error: prepared statement «pg8000_statement_0» already exists

2019-01-23 Thread Massimiliano
Could be. When you strart web2py it show database driver available: Mine: Database drivers available: psycopg2, pymysql, imaplib, sqlite3, pg8000, pyodbc, pymongo On Wed, Jan 23, 2019 at 10:59 AM Lisandro wrote: > Thanks Massimiliano. > > Apparently psycopg2 is already installed (of course

Re: [web2py] Error: prepared statement «pg8000_statement_0» already exists

2019-01-23 Thread Massimiliano
Try to uninstall psycopg2-* and reinstall only psycopg2-binary On Wed, Jan 23, 2019 at 11:52 AM Massimiliano wrote: > Could be. > > When you strart web2py it show database driver available: > Mine: > Database drivers available: psycopg2, pymysql, imaplib, sqlite3, pg8000, > pyodbc, pymongo > >

Re: [web2py] Error: prepared statement «pg8000_statement_0» already exists

2019-01-23 Thread Massimiliano
Have you tried to install psycopg2? Is the standard de facto postgresql driver. The pip package should be psycopg2-binary On Wed, Jan 23, 2019 at 10:39 AM Lisandro wrote: > Hi there! Yesterday I had a MAJOR downtime and I would need your help to > understand what happened. > > The team that is

Re: [web2py] Error: prepared statement «pg8000_statement_0» already exists

2019-01-23 Thread 黄祥
perhaps this conversation can give a hint: https://github.com/DataDog/dd-agent/issues/2755 did you backup the server before upgrade? best regards, stifan -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Error: prepared statement «pg8000_statement_0» already exists

2019-01-23 Thread Lisandro
Hi there! Yesterday I had a MAJOR downtime and I would need your help to understand what happened. The team that is in charge of upgrading security packages at my server (CentOS 7 at Linode) did an update that involved an upgrade to pgBouncer. Accordingly to what they said, they noticed

Re: [web2py] Error: prepared statement «pg8000_statement_0» already exists

2019-01-23 Thread Lisandro
Another weird stuff I noticed: in my server, if I open a terminal, run python and try to import psycopg2, I receive an error: >>> import psycopg2 Traceback (most recent call last): File "", line 1, in File "/usr/lib64/python2.7/site-packages/psycopg2/__init__.py", line 50, in from

Re: [web2py] Error: prepared statement «pg8000_statement_0» already exists

2019-01-23 Thread Lisandro
Thank you all for that notes. When I run web2py at my server, I see this available drivers: sqlite3, imaplib, pymysql, pg8000 I don't see psycopg2, so I presume it will be available if I uninstall those two versions and install the psycopg2-binary version. One additional question: which driver

[web2py] standalone templates

2019-01-23 Thread Carlos Cesar Caballero Díaz
Hi guys, I am using the web2py templates in a side project and I want to include some variables in the environment by default, something like how helpers, request and response are included in the framework, but I can't find how this is done. Any idea? Greetings. -- Resources: -

Re: [web2py] standalone templates

2019-01-23 Thread Carlos Cesar Caballero Díaz
Hi sandeep patel, thanks for your answer. In my use case I am using the template module outside web2py as a standalone package, and I need to inject some objects in the template by default. I am not using the whole web2py framework. Greetings. El 23/1/19 a las 8:58 a.m., sandeep patel

Re: [web2py] standalone templates

2019-01-23 Thread sandeep patel
Thanks for clarification @Carloas, You can extend the template module classes. According to your need then you can inject whatever object you want as a default. Please correct me if I am in the wrong direction Thanks SP On Wed, Jan 23, 2019 at 7:42 PM Carlos Cesar Caballero Díaz <

Re: [web2py] standalone templates

2019-01-23 Thread Carlos Cesar Caballero Díaz
Basically web2py injects to the template things like html helpers and response or request objects, I just want to find how this is done, for example, the jinja2 templates has the Environment.globals list for include objects in the template context, I am looking for a functionality like that in