[web2py] Re: Scaffold Web2py Models and SQLForm.smartgrid

2019-05-21 Thread Massimo Di Pierro
This is very old. Not sure anybody is maintaining it and what the limitations are. It never got much love. http://www.web2py.com/sqldesigner It is on my web site so I must have the source code if you want it. Massimo On Sunday, 19 May 2019 11:07:54 UTC-7, Kevin Keller wrote: > > Hello, >

[web2py] Re: Web3py

2019-05-21 Thread Massimo Di Pierro
delete everything in /tmp/web3py and restart it. This folder should really be created in the cwd not in /tmp/ I will change it. On Monday, 20 May 2019 07:17:14 UTC-7, En Ware wrote: > > Getting error missing table , sqlite3.OperationalError: no such table: > web3py_error > > _dashboard won't

[web2py] Post SQLing

2019-05-21 Thread Dave S
I've got my AWS linux system ticking along nicely with my heavy table under PostGres [1], but I still have uploads, Auth, and Scheduler under sqlite. I'd like to move them to PostGres, so I'm double checking that I'm using the appropriate steps to get there: 1. Create uploads table by copying

[web2py] Return Storage as json causes 'NoneType' object is not callable

2019-05-21 Thread Val K
Hello! I use windows binaries (2.18.5-stable+timestamp.2019.04.08.04.22.03) and get *'NoneType' object is not callable* when call this simple function: from gluon.tools import Storage @service.json def echo(): return Storage(a=1) # return dict(a=1) - works fine 5048. 5049. 5050. 5051.

Re: [web2py] Re: javascript from ajax with :eval question

2019-05-21 Thread Eliezer (Vlad) Tseytkin
Aaahhh got it Thank you very much!! On Tue, May 21, 2019, 7:14 PM Junior Phanter wrote: > # controller return javascript(Jquery) to eval > def echo: > import json > return "$('#target').html(%s)" %(json.dumps(DIV("Hello", > STRONG("world"), "Escape this?").xml())) > > #view > > get

Re: [web2py] Re: javascript from ajax with :eval question

2019-05-21 Thread Junior Phanter
# controller return javascript(Jquery) to eval def echo: import json return "$('#target').html(%s)" %(json.dumps(DIV("Hello", STRONG("world"), "Escape this?").xml())) #view get from echo $("#your_button").on("click", function(){ url_ajax = "{{=URL("your_controler", "echo")}}"

Re: [web2py] Re: javascript from ajax with :eval question

2019-05-21 Thread Eliezer (Vlad) Tseytkin
I am very familiar with controllers/views/helpers the way you just specified, but it doesn't help me because here is my context: I am using ajax function from JavaScript, as a response to a certain event on the page. This ajax is called with :eval option which allows me to construct actual

Re: [web2py] Re: javascript from ajax with :eval question

2019-05-21 Thread Eliezer (Vlad) Tseytkin
Could you please clarify: You mentioned {{=json.dumps()}} which looks like code executed in Python. But in "result+=" I am constructing an expression which is actually executed in JavaScript. Did you mistype or I'm missing something? On Tue, May 21, 2019, 5:59 PM Junior Phanter wrote: >

[web2py] Re: javascript from ajax with :eval question

2019-05-21 Thread villas
Not sure what you are trying to do, work in the controller or view, or why you are trying to append with JS. Maybe you could learn to use the web2py helpers... e.g. controller def example(): cart = db(db.cart).select().as_list() mydiv = DIV(cart, _id='Debug_Discount' ) return

Re: [web2py] Re: javascript from ajax with :eval question

2019-05-21 Thread Junior Phanter
resultado + = {{=json.dumps(DIV().xml())}} Em ter, 21 de mai de 2019 às 13:41, Vlad escreveu: > ALMOST :) > > result += ASSIGNJS(cart=cart) > result += "$('#Debug_Discount').append(''+cart+'');" > > this comes out as [object Object] > > But generated Javascript (as far as the object's

Re: [web2py] Re: Rows class constructor question

2019-05-21 Thread Eliezer (Vlad) Tseytkin
Got it, Thank you very much! On Tue, May 21, 2019, 2:09 PM Leonel Câmara wrote: > It basically has to do with python namespaces. You did not import Rows > into your current namespace. The definition is there in the context where > the select rows were created but in your namespace you could

[web2py] Re: Rows class constructor question

2019-05-21 Thread Leonel Câmara
It basically has to do with python namespaces. You did not import Rows into your current namespace. The definition is there in the context where the select rows were created but in your namespace you could have another Rows definition that is quite different or none at all. Web2py imports a lot

[web2py] Re: Rows class constructor question

2019-05-21 Thread Vlad
Yeah, I am just trying to understand why it doesn't work without explicit import. Missing basics here: if rows=db.select() works and rows is known to be an instance of the class Rows, and Rows is recognized as a class and can be used to some extent (obviously, I am using it already, in

[web2py] Re: javascript from ajax with :eval question

2019-05-21 Thread Vlad
ALMOST :) result += ASSIGNJS(cart=cart) result += "$('#Debug_Discount').append(''+cart+'');" this comes out as [object Object] But generated Javascript (as far as the object's content is concerned) seems right - I think I am missing the final touch, some javascript trick that would

[web2py] Re: authentication variables in url when login is incorrect

2019-05-21 Thread Fred Nikolayevich
Ok I think I found it: In gluon/tools.py in the Auth.login() method the line 2643 has been changed from redirect(self.url(args=request.args, vars=request.*get_vars* ),client_side=settings.client_side) to redirect(self.url(args=request.args, vars=request.*vars*

[web2py] Re: Rows class constructor question

2019-05-21 Thread villas
rows = pydal.objects.Rows() On Tuesday, 21 May 2019 04:14:45 UTC+1, Vlad wrote: > > I must be missing something very basic here... > > Want to create an empty Rows object, and then to append to it sets of rows > from various sql queries with the same structure of the result sets. > > The

[web2py] authentication variables in url when login is incorrect

2019-05-21 Thread Fred Nikolayevich
Hi, I have a problem with the ldap auth since I upgraded my application from web2py 2.14.6 on Python 2.7 to the current web2py 2.18.5 on Python 3.7. In the old version when I logged in with incorrect credentials it would reload the login page:

[web2py] Re: Web3py

2019-05-21 Thread En Ware
That was it thanks. On Tuesday, May 21, 2019 at 10:05:56 AM UTC-5, Massimo Di Pierro wrote: > > There should be web3py folder in /tmp delete it and restart -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: javascript from ajax with :eval question

2019-05-21 Thread villas
Maybe this: ASSIGNJS http://www.web2py.com/books/default/chapter/29/05/the-views#ASSIGNJS On Tuesday, 21 May 2019 15:43:25 UTC+1, Vlad wrote: > > I am calling ajax function with :eval and setting up some javascript [from > the controller] to be executed [as per :eval option js is executed in

[web2py] Re: Web3py

2019-05-21 Thread Massimo Di Pierro
There should be web3py folder in /tmp delete it and restart -- 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

[web2py] javascript from ajax with :eval question

2019-05-21 Thread Vlad
I am calling ajax function with :eval and setting up some javascript [from the controller] to be executed [as per :eval option js is executed in the end], something like this: result = "$('#DebugID').append('" result += "CONTENT" result += "');" return result Now, this works,

[web2py] Re: Web3py

2019-05-21 Thread En Ware
./web3py-start apps/ ___ __ __ | / / / / __ |/___ \/ __ \ \/ / | | / / /_ / /_/ /___/ / /_/ /\ / | | /| / / __/ / __ //__ / / / / | |/ |/ / /___/ /_/ /___/ / / / / |___/|_/_/_/_/_/ /_/ It is still experimental... Dashboard

[web2py] Re: Web3py

2019-05-21 Thread En Ware
The only thing I did was: 1. git pull 2. ./web3py-start apps/ Thats all I did. On Monday, May 20, 2019 at 3:08:26 PM UTC-5, 黄祥 wrote: > > Getting error missing table , sqlite3.OperationalError: no such table: >> web3py_error >> >> _dashboard won't load at all. >> > > could you please tell

[web2py] Re: Rows class constructor question

2019-05-21 Thread Vlad
Leonel, in your example, if "import peartree" doesn't bring in Pear (and thus Pear needs to be imported explicitly) - then... How is Pear accessible at all? I mean, if Pear is not accessible - then what's the difference between direct usage and indirect usage? I guess I am missing something

[web2py] Re: Rows class constructor question

2019-05-21 Thread Leonel Câmara
If you have a module called peartree.py which has only this class Pear: pass def shake(): return Pear() If in another module you do: import peartree mypear = peartree.shake() mypear will be an instance of Pear, however Pear is not defined in this context and you cannot use the

Re: [web2py] Re: Rows class constructor question

2019-05-21 Thread Eliezer (Vlad) Tseytkin
Oops, I thought that if DAL is used extensively and all works already, all the proper classes are already imported by the environment (otherwise how can I run queries and do other db-related stuff without importing those classes explicitly??) How can rows=db.select work and return 'rows', which is

[web2py] Re: Rows class constructor question

2019-05-21 Thread Leonel Câmara
You need to import Rows from pydal.objects -- 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

[web2py] Re: Using parse_as_rest: problem with cross joins?

2019-05-21 Thread Massimo Di Pierro
Will release at the end of the month -- 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

[web2py] Re: Web3py Auth

2019-05-21 Thread villas
Many2many: I think a generic tagging api is a great idea in general for web3py. If we can leverage that for auth groups too, then why not. Clearly a link table adds complexity to all the queries, but if this is properly serviced by the api, then no prob. Hierachical tagging, nested sets

[web2py] Re: Web3py Auth

2019-05-21 Thread Leonel Câmara
I use the groups and permissions mechanics extensively in my applications. They're useful for lots of stuff. Sharing can be as simple as giving permission for a record. I also use tags for the same purpose but they're better for stuff which will be changing based on properties of an entity

[web2py] Re: Add button to smartgrid?

2019-05-21 Thread rāma
Or better: links=dict(meter_list=[lambda row: A( [SPAN(_class="menu-icon fa fa-paper-plane"), SPAN("Go To "+str(row.id), _class="buttontext button", _title="GoTo")] , _href="TEST",

[web2py] Re: Add button to smartgrid?

2019-05-21 Thread rāma
I used: for x in grid.elements('td.row_buttons'): x.insert(4, A( [SPAN(_class="menu-icon fa fa-paper-plane"), SPAN("Go To", _class="buttontext button", _title="GoTo")] , _href="TEST", _class="button btn btn-default btn-secondary")) This is specific to my needs, you may not