[web2py] Re: I would like to log of all SQL commands web2py sends to SQLite. Is it possible?

2019-04-16 Thread Dave S
On Monday, April 15, 2019 at 4:27:22 AM UTC-7, João Matos wrote: > > Thanks Anthony. > > I went with a simple solution that serves my purpose (it's a temporary > need). > > I added this code starting with # JM to the > gluon\packages\dal\pydal\adapters\base.py at line 413. > Good thing it's a

Re: [web2py] Re: Problem with oracle query

2019-04-16 Thread gliporace
I didn't create the table, I was trying to connect to a read-only view from one of our oracle servers, I'm just a user:) Thanks for the explanation though, now I changed the name of the table to uppercase in the model definition and it works without entity_quoting = False. Gianfranco. Il giorno

[web2py] Re: Web3py

2019-04-16 Thread 黄祥
nice dashboard, only myapp can work from dashboard link some strange behaviour, when accessing dashboard (without index), it automatic add dashboard/static/index.html, while for another web app is not, must add index manually. sorry forgot to test about docker-compose (not work either, guess the

[web2py] Controller/function called via ajax() returns javascript inside JS

2019-04-16 Thread Octavian G
Hello, Using web2py-1.18.5. Calling a controller/function via: onclick="ajax('{{=URL('bla', 'bla.load', vars={'whatever': 'all'})}}', [], ':eval') Inside the function, there is: script = "$ javascript code here;" return script The generic.load is the default one. Jquery complains tha

[web2py] CORS headers on static file

2019-04-16 Thread David Orme
Hi, I'm running a static website from an S3 bucket that calls an API running on web2py and I've run into a problem with CORS. I can update the headers for API calls by editing the calls() controller: def call(): """ exposes services. for example: http:///[app]/default/call/json

[web2py] Re: howto prevent XSS in json data

2019-04-16 Thread Leonel Câmara
Another thing you can do is simply quote the name import urllib filter_settings = dict(name=urllib.quote(request.vars.name)) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list

[web2py] Re: Web3py

2019-04-16 Thread 黄祥
after learn the code *web3py/web3py/core.py* python3 /web3py/web3py-start /web3py/applications/ is automatically run the address 127.0.0.1:8000 so the correct one to make it run on docker should use : python3 /web3py/web3py-start /web3py/applications/ --address 0.0.0.0:8000 think there are two op

[web2py] Re: Smartgrid link very slow.

2019-04-16 Thread David Manns
The problem is with SQLFORM.grid Table Affiliations has some 5,000 rows. Each row has references to 2 other tables, Members and Colleges each of which has format=... so it displays text rather than the id as a number. So SQLFORM.grid(db.Affiliations.Member==, will correctly display only t

[web2py] Re: database queries

2019-04-16 Thread learthurjoly
Hello, I'm sorry if I did not post my tests but I’m really beginner with web2py, python... and I was a little afraid to look ridiculous.. (Sorry again but my English is ridiculous too !!). First I tried with Mysql trough MysqlWorkbench and I quickly success to get the minimum but only for a

[web2py] Re: Does web2py support SSE (server sent events) from HTML5?

2019-04-16 Thread Anthony
If you are using Nginx as a proxy server, you might consider Nchan . It holds the HTTP/websocket connections and has a pubsub system, and your web2py app simply sends and receives regular short-lived HTTP requests. Similar alternatives are Centrifugo

[web2py] Re: Web3py

2019-04-16 Thread En Ware
Getting error | / / / / __ |/___ \/ __ \ \/ / | | / / /_ / /_/ /___/ / /_/ /\ / | | /| / / __/ / __ //__ / / / / | |/ |/ / /___/ /_/ /___/ / / / / |___/|_/_/_/_/_/ /_/ It is still experimental... Traceback (most recent call last): File "/Users/aaronm/.

Re: [web2py] Re: Web3py

2019-04-16 Thread António Ramos
Not working... [image: image.png] Em ter, 16 de abr de 2019 às 14:41, En Ware escreveu: > Getting error > > | / / / / __ |/___ \/ __ \ \/ / > | | / / /_ / /_/ /___/ / /_/ /\ / > | | /| / / __/ / __ //__ / / / / > | |/ |/ / /___/ /_/ /___/ / / / / > |___/|_/_/_/_

[web2py] Re: howto prevent XSS in json data

2019-04-16 Thread Alex
Thanks for your suggestions. Although nothing gets me the desired result. If I use urllib.quote or XML in the controller way too much gets escaped (all < and > signs, blanks, etc.) which is not what I want. And I'd have to do this for all attributes in every controller function. My problem is e

[web2py] Does anyone know if web2py supports the IN operator in a query?

2019-04-16 Thread João Matos
Does anyone know if web2py supports the IN operator in a query? Doesn't seem to accept this db(db.wo.id in [1,2,3]).select() that would translate to SQL like this SELECT * FROM wo WHERE id IN (1, 2, 3) -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.

[web2py] Is it possible to update a Rows object with another Rows object?

2019-04-16 Thread João Matos
Is it possible to update a Rows object with another Rows object? I would like to do something similar to this (except that update does not exist in Rows) rows = db(db.wo.id == int(request.args[0])).select() if len(request.args) > 1: for id_ in request.args[1:]: rows.update(db(db.wo.i

[web2py] Re: Does web2py support SSE (server sent events) from HTML5?

2019-04-16 Thread João Matos
Thanks Anthony, but I'm using Apache. Do you know any current solution for Apache? Do you recommend Nginx over Apache? If so, why? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issue

[web2py] Re: Does anyone know if web2py supports the IN operator in a query?

2019-04-16 Thread João Matos
Found the solution using .belongs() terça-feira, 16 de Abril de 2019 às 16:07:48 UTC+1, João Matos escreveu: > > Does anyone know if web2py supports the IN operator in a query? > > Doesn't seem to accept this > > db(db.wo.id in [1,2,3]).select() > > that would translate to SQL like this > > SELECT

Re: [web2py] Re: Web3py

2019-04-16 Thread En Ware
Is web3py running ? Do you see this in your terminal ? Bottle v0.12.16 server starting up (using WSGIRefServer())... Listening on http://127.0.0.1:8000/ Hit Ctrl-C to quit. Have you git pulled the latest changes ? How did you start web3py server ? On Tuesday, April 16, 2019 at 10:02:46 AM UT

[web2py] Re: Web3py

2019-04-16 Thread 黄祥
On Tuesday, April 16, 2019 at 8:41:50 PM UTC+7, En Ware wrote: > > Getting error > > | / / / / __ |/___ \/ __ \ \/ / > | | / / /_ / /_/ /___/ / /_/ /\ / > | | /| / / __/ / __ //__ / / / / > | |/ |/ / /___/ /_/ /___/ / / / / > |___/|_/_/_/_/_/ /_/ > It is

[web2py] Re: Is it possible to update a Rows object with another Rows object?

2019-04-16 Thread João Matos
The solution is simply to add them :) http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Combining-rows Got help in the Telegram Web2py International Support Group at https://t.me/web2py_world/ terça-feira, 16 de Abril de 2019 às 16:11:09 UTC+1, João Matos escreveu: >

[web2py] Re: Web3py

2019-04-16 Thread Massimo Di Pierro
You have an old pydal. Do pip3 install --upgrade pydal Also do python3 web3py.py applications Not python3 web3py.py applications/todo/ -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py

[web2py] Re: Web3py

2019-04-16 Thread En Ware
Thank you , that did it. On Tuesday, April 16, 2019 at 2:42:40 PM UTC-5, Massimo Di Pierro wrote: > > You have an old pydal. Do > > pip3 install --upgrade pydal > > Also do > > python3 web3py.py applications > > Not > > python3 web3py.py applications/todo/ > > -- Resources: - http://web2py.com -

[web2py] Re: How do i update a database value with a new computed value from a controller function

2019-04-16 Thread Dave S
On Monday, April 15, 2019 at 10:13:30 PM UTC-7, mostwanted wrote: > > I have a database of items sold, I am updating the quantity of an item by > subtracting the amount purchased from the current available Quantity. How > do i replace the old value with the difference between the current value

[web2py] Re: Is it possible to update a Rows object with another Rows object?

2019-04-16 Thread Anthony
On Tuesday, April 16, 2019 at 11:11:09 AM UTC-4, João Matos wrote: > > Is it possible to update a Rows object with another Rows object? > > I would like to do something similar to this (except that update does not > exist in Rows) > > rows = db(db.wo.id == int(request.args[0])).select() > if len(r

[web2py] Re: Is it possible to update a Rows object with another Rows object?

2019-04-16 Thread João Matos
Thanks Anthony. I found out about belongs after posting. terça-feira, 16 de Abril de 2019 às 21:51:03 UTC+1, Anthony escreveu: > > On Tuesday, April 16, 2019 at 11:11:09 AM UTC-4, João Matos wrote: >> >> Is it possible to update a Rows object with another Rows object? >> >> I would like to do som

[web2py] Re: database queries

2019-04-16 Thread Dave S
On Tuesday, April 16, 2019 at 5:54:54 AM UTC-7, learth...@gmail.com wrote: > > [skipping to what caught my eye first] > Then I tried to do it by referring to what I found in the web2py manual. > > That’s where I am now. This is only for the price but it’s the same for > the delay. > > > > pa

[web2py] Re: one form multiple submits

2019-04-16 Thread Ben Lawrence
The _value is the word that appears inside the button on the web-page. It seems "Working..." is the value in form.vars where the key is _name. regards Ben On Thursday, April 11, 2019 at 3:20:23 PM UTC-7, Dave S wrote: > > > > On Thursday, April 11, 2019 at 10:03:34 AM UTC-7, Ben Lawrence wrote:

[web2py] Re: database queries

2019-04-16 Thread Dave S
On Tuesday, April 16, 2019 at 5:54:54 AM UTC-7, learth...@gmail.com wrote: > > Hello, > > I'm sorry if I did not post my tests but I’m really beginner with web2py, > python... and I was a little afraid to look ridiculous.. (Sorry again but > my English is ridiculous too !!). > > First I tried w

[web2py] Re: howto prevent XSS in json data

2019-04-16 Thread Dave S
On Tuesday, April 16, 2019 at 8:03:55 AM UTC-7, Alex wrote: > > Thanks for your suggestions. Although nothing gets me the desired result. > If I use urllib.quote or XML in the controller way too much gets escaped > (all < and > signs, blanks, etc.) which is not what I want. And I'd have to > d

[web2py] Re: one form multiple submits

2019-04-16 Thread Dave S
On Tuesday, April 16, 2019 at 2:56:53 PM UTC-7, Ben Lawrence wrote: > > The _value is the word that appears inside the button on the web-page. It > seems "Working..." is the value in form.vars where the key is _name. > > regards > Ben > All the other buttons show up in form.vars as well? I'd h

[web2py] Re: Does web2py support SSE (server sent events) from HTML5?

2019-04-16 Thread Anthony
On Tuesday, April 16, 2019 at 11:14:10 AM UTC-4, João Matos wrote: > > Thanks Anthony, but I'm using Apache. > > Do you know any current solution for Apache? > You should be able to run Centrifugo or Pushpin side-by-side with Apache (on a different port). You could even run Nginx alongside Apach

[web2py] Re: Datatables add buttons on each row and pass args to controller function

2019-04-16 Thread Massimo Di Pierro
I am not familiar with how database reads arguments but try replace href='{{=URL('Herramientas','usuarioUpdate',args=["users.id"])}}' with href='{{=URL('Herramientas','usuarioUpdate'}}/users.id' because anything in between {{...}} is executed by the server before it gets to datatables. Also

[web2py] Re: Controller/function called via ajax() returns javascript inside JS

2019-04-16 Thread Massimo Di Pierro
Not enough information. can you post a more complete example we can run? On Tuesday, 16 April 2019 02:26:13 UTC-7, Octavian G wrote: > > Hello, > > Using web2py-1.18.5. Calling a controller/function via: > > onclick="ajax('{{=URL('bla', 'bla.load', vars={'whatever': 'all'})}}', > [], ':eval'

[web2py] Re: CORS headers on static file

2019-04-16 Thread Massimo Di Pierro
The usual process for CORS is to put web2py behind nginx and configure nginx for CORS On Tuesday, 16 April 2019 03:45:28 UTC-7, David Orme wrote: > > Hi, > > I'm running a static website from an S3 bucket that calls an API running > on web2py and I've run into a problem with CORS. I can update