[web2py] Re: join and count()

2018-04-14 Thread 'Annet' via web2py-users
Hi Anthony, Thanks for your reply. Does this work: > > label_count = db.vtx_label.id.count() > count = rowset.select(label_count, join=join).first()[label_count] > > Yes, that works, but I don't understand why it works, could you please explain how your solution works? The table vtx_labels cont

[web2py] Re: join and count()

2018-04-14 Thread Anthony
vtx_label is one of the tables involved in the join, so this query just counts one of the fields in that table, which should give a single count per row returned by the query. Should work the same if you use db.vtx_vertex.id.count() or any other field in either table. The point is just to do a

Re: [web2py] Re: auth decorator with rest api

2018-04-14 Thread Anthony
Hard to say what is going on. Would have to see how these Ajax calls are being made and what response is received by the browser. What is the URL in the address bar of the browser? Is the site being served by web2py (port 8000) or by an angular development server (port 4200)? Anthony On Saturd

[web2py] Problem with a virtual field, SQLFORM.grid and the fields parameter

2018-04-14 Thread Martin Weissenboeck
I have a model with a virtual field: db.define_table("tt", Field("f"), Field("gg"), Field.Virtual("ff", lambda r:r.tt.f) ) And a grid: def t(): form = SQLFORM.grid( db.tt, ) return dict(form=form) Works fine. But with the *field argument* I get an e

[web2py] Re: PYTHON 3

2018-04-14 Thread Mamisoa Andriantafika
Hi, I would agree that the docs should be updated: download page, deployment in web2py group etc... Le mardi 10 avril 2018 00:10:35 UTC+2, Jurgis Pralgauskis a écrit : > > Would be good if Py3 support would be highlighted in Instructions > http://web2py.com/init/default/download > as now it

[web2py] Re: Problem with a virtual field, SQLFORM.grid and the fields parameter

2018-04-14 Thread Anthony
> But with the *field argument* I get an error: > > def t(): > form = SQLFORM.grid( > db.tt, > *fields=[**db.tt.ff]* > ) > return dict(form=form) > > What happens if you remove the "fields" argument and instead limit which fields display by setting their "