[web2py] Re: Is it possible to sort the grid search fields list?

2019-04-03 Thread João Matos
Found a solution. In the controller, after grid creation: # Sort grid's search fields list. grid.element('#w2p_query_fields').components = sort_grid_search_fields_list(grid) In a modules file def sort_grid_search_fields_list(grid): # type: (grid: gluon.DIV) ->

[web2py] compile_application() not including symlinked views (while it includes symlinked controllers)

2019-04-03 Thread Lisandro
I have an application that uses symlinks for some of its controllers, models and views. Symlinked controllers and models are compiled properly, but something weird happens with symlinked views. For example, this symlinked controller: controllers/test.py --> *symlink to external file* ... is

[web2py] Re: How can I convert a SUM from a SQLite SELECT statement to web2py's DAL?

2019-04-03 Thread João Matos
Thanks. quarta-feira, 3 de Abril de 2019 às 17:12:44 UTC+1, tim@conted.ox.ac.uk escreveu: > > Apologies. Left a lot of cruft in there which should be edited out now. > > On Wednesday, 3 April 2019 17:10:49 UTC+1, tim@conted.ox.ac.uk wrote: >> >> That will be different. SQLFORM.grid

[web2py] Re: How can I convert a SUM from a SQLite SELECT statement to web2py's DAL?

2019-04-03 Thread tim . nyborg
Apologies. Left a lot of cruft in there which should be edited out now. On Wednesday, 3 April 2019 17:10:49 UTC+1, tim@conted.ox.ac.uk wrote: > > That will be different. SQLFORM.grid doesn't support aggregation, so > you'll need to use virtual fields to do the work, which is what I do to

[web2py] Re: How can I convert a SUM from a SQLite SELECT statement to web2py's DAL?

2019-04-03 Thread tim . nyborg
That will be different. SQLFORM.grid doesn't support aggregation, so you'll need to use virtual fields to do the work, which is what I do to show invoices along with their current calculated balance. It's not sortable, though. Something like: def is_operador(row): return not idb(

[web2py] Re: How can I convert a SUM from a SQLite SELECT statement to web2py's DAL?

2019-04-03 Thread João Matos
Thanks. That worked. I just corrected the groupby you sent. Now I have another problem. Unfortunately a SQLFORM.grid doesn't accept a SELECT. The only solution I have is to create a view in SQLite, which defies the purpose of moving from the SQLite SELECT to DAL. Any ideas on how I can solve

[web2py] Re: How can I convert a SUM from a SQLite SELECT statement to web2py's DAL?

2019-04-03 Thread tim . nyborg
I think that implicit conversion of "auth_group.role = 'Operador'" to a 1 is a Sqlite-specific thing. What you want to use here is case: query = db().select( db.auth_user.id, db.auth_user.username, db.auth_user.canceled_on, db.auth_user.canceled_by, (db.auth_group.role ==

[web2py] Re: How can I disable auto-login after registration?

2019-04-03 Thread João Matos
Thanks for the explanation Leonel. However I find it unfortunate that auth.settings.login_after_registration isn't named auth.settings.second_login_after_registration quarta-feira, 3 de Abril de 2019 às 16:07:12 UTC+1, Leonel Câmara escreveu: > > If you don't have

[web2py] Re: How can I disable auto-login after registration?

2019-04-03 Thread Leonel Câmara
If you don't have auth.settings.registration_requires_verification = True then web2py will login the user anyway, which kind of makes sense, because why wouldn't it? The login_after_registration setting is really just a way to bypass those requirements if you want to let the user get logged in

[web2py] How to disable _next when auto-logout? Or how do I make it maintain the var _signature?

2019-04-03 Thread João Matos
Hello, How to disable _next when auto-logout occurs? Or how do I make it maintain the var _signature? I have this problem. If a user leaves the application open, for eg. in a record editing page with this URL http:

[web2py] How can I disable auto-login after registration?

2019-04-03 Thread João Matos
Hello, How can I disable auto-login after registration? I've tried auth.settings.login_after_registration = False but doesn't work. Thanks, JM -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) -

[web2py] Re: How can I block logins from users with is_active == False?

2019-04-03 Thread João Matos
Thanks for the feedback Anthony. -- 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: How can I block logins from users with is_active == False?

2019-04-03 Thread Anthony
How are you setting is_active to False? Are you doing it manually, or is it happening via a delete with record versioning enabled (as described here )? If the latter, you don't need to do any check,

[web2py] Re: Compressed bootstrap.min.css

2019-04-03 Thread Константин Комков
As I understand something was wrong on server. I had directory on server which contain static gzip files already for all projects but maybe it was not updated. I added in config: Deleted unnecessary css and js files and restart server. Now all is ok with compression css which had size 196 KB

[web2py] Re: How can I convert a SUM from a SQLite SELECT statement to web2py's DAL?

2019-04-03 Thread Dave S
On Tuesday, April 2, 2019 at 5:09:56 PM UTC-7, João Matos wrote: > [complex scenario] > Any ideas? > Since my level of knowledge would give one of sums or rows, but not both, I'm hoping the regulars chip in. I have a small amount of experience with subselects in the SQLite command line