Re: [web2py] Web2py sessions in scheduler

2020-02-17 Thread Massimo Di Pierro
Try session._forget = True Yet this should not be happening so hard to suggest a fix without seeing the code. On Monday, 17 February 2020 17:44:32 UTC-8, Frédéric Samson wrote: > > I tried this in the model file : > > if request.is_scheduler: > session.forget(response) > > and > > if reques

[web2py] Re: py4web translations

2020-02-17 Thread Massimo Di Pierro
You have to pass T to the view @action('index') @action.uses('index.html', T) def index(): return dict(message="hello world", T=T) # in view [[=T(message)]] or @unauthenticated def index(): return dict(message="hello world") and it is all automatic. Need the latest common.py fro

[web2py] Re: PY4WEB socketIO

2020-02-17 Thread Massimo Di Pierro
It would be trivial to implement it like flask does. You can do it right now using the bottlepy way: https://pypi.org/project/bottle-websocket/ or https://github.com/marlboromoo/bottle-socketio-example py4web uses bottle under the hood. The problem is that I would like something better than that

[web2py] Re: MySQL server has gone away - py4web

2020-02-17 Thread Massimo Di Pierro
sorry. My bad. try: +self._adapter.reconnect() On Sunday, 16 February 2020 19:17:25 UTC-8, Marcello wrote: > > I got this error: > > File "/home/parra/py4web/py4web/core.py", line 239, in on_request > db._adapter.reconnect() > NameError: name 'db' is not defined > > > > > On Sunday, F

[web2py] Re: validator formatter when validation fails

2020-02-17 Thread Massimo Di Pierro
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

[web2py] py4web translations

2020-02-17 Thread clara
Hi, I just tried using translations in a template in py4web: [[ =T('some text') ]] but it doesn't work. I tried importing T in the template but then I got: "No module named 'yatl.common'" Probably I am overlooking something... Any help will be appreciated! Thanks, Clara -- Resources: - h

Re: [web2py] Web2py sessions in scheduler

2020-02-17 Thread Frédéric Samson
I tried this in the model file : if request.is_scheduler: session.forget(response) and if request.is_scheduler: session.forget() but it still store sessions in the database. Le lundi 17 février 2020 09:54:43 UTC-5, Massimiliano a écrit : > > Have you tried if > > *session.forget(response)* o

[web2py] select for list:integer, but in a specific position

2020-02-17 Thread p a
Hello! Long time no see: I have a Field 'parameters' of type "list:integer", something like: db.define_table('operation', Field('type', 'integer'), Field('parameters','list:integer') ) The Field db.operation.parameters has a method 'contains' that I can use in queries, lik

[web2py] validator formatter when validation fails

2020-02-17 Thread Eric
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(). Since

[web2py] Re: PY4WEB socketIO

2020-02-17 Thread António Ramos
also rooms ... https://flask-socketio.readthedocs.io/en/latest/ Em seg., 17 de fev. de 2020 às 18:31, António Ramos escreveu: > hello , just asking if py4web will have the ability like flask to have a > socket as simple as ... > Regards > > @socketio.on('my event')def handle_my_custom_event(arg

[web2py] PY4WEB socketIO

2020-02-17 Thread António Ramos
hello , just asking if py4web will have the ability like flask to have a socket as simple as ... Regards @socketio.on('my event')def handle_my_custom_event(arg1, arg2, arg3): print('received args: ' + arg1 + arg2 + arg3) -- Resources: - http://web2py.com - http://web2py.com/book (Documentat

Re: [web2py] Web2py sessions in scheduler

2020-02-17 Thread Massimiliano
Have you tried if *session.forget(response)* or *session.forget() *can help you? http://web2py.com/books/default/chapter/29/04/the-core?search=session.forget#session On Mon, Feb 17, 2020 at 12:33 PM Frédéric Samson wrote: > Every scheduler task that is running stores a session in my database.

Re: [web2py] How i remove the export label in the SQLFORM.grid after removing the exportclasses?

2020-02-17 Thread Massimiliano
in the options's grid: grid(.., csv=False) http://web2py.com/books/default/chapter/29/07/forms-and-validators#SQLFORM-grid On Sat, Feb 15, 2020 at 8:58 PM mostwanted wrote: > Hi guys, I was able to remove the export classes > > *exportclasses=dict(xml=False, html=False, json=False, csv=False,

[web2py] Web2py sessions in scheduler

2020-02-17 Thread Frédéric Samson
Every scheduler task that is running stores a session in my database. Is there a way to not to store the session when request.is_scheduler is true? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com

[web2py] Re: Redirect with code 301

2020-02-17 Thread Clemens
Hello Alexander, what you're trying will be blocked by most browsers since it is security issue. That a website is redirecting the user to another website is always suspicious. What you can try, is to solve this by a CNAME Resource Record .

[web2py] Re: Many records in one transaction

2020-02-17 Thread Clemens
Hello! I guess that your mean by importing, reading data from the database. if so, without any further information I can only suggest the following workaround: - Try reading not the whole data (all rows) at once. Maybe you can select part of it by the selecting the different faculties by