[web2py] how to reset_password_key programmatically?

2017-04-20 Thread lucas
hello one and all, I am trying to setup Managers, like one per firm, in which a Manager can add and update users under auth_user. only for their firm. if the manager sets up a new user or forces the user to change their password, how do I signal to web2py that the user needs to update or chan

[web2py] Re: Returning a token for Android app authentication

2017-04-20 Thread Oasis Agano
The only challenge im facing is the needed customization on the W2P side to allow the the app to login, and the route to use inside the mobile app to pass the login credentials. If someone can share a segment of the code it can be helpful. Thanks. Oasis On Tuesday, April 18, 2017 at 12:25:38 AM

[web2py] Saving User bandwidth consumed

2017-04-20 Thread Sharjeel Ali Shaukat
Please help regarding bandwidth , how user usage of bandwidth should taken from web2py application , application requirement is to check the bandwidth size consumed per logged in user -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py

Re: [web2py] Re: Make web2py update tables schemas auto

2017-04-20 Thread Áureo Dias Neto
Yes, I'm working with legacy tables that were already existing in MySql before you hooked your application to that databases, and I added fields to my models, and this not reflect on the db Em 19 de abr de 2017 21:28, "Dave S" escreveu: > > > On Wednesday, April 19, 2017 at 4:42:33 PM UTC-7, Áur

[web2py] Re: @auth.requires for functions

2017-04-20 Thread Andrea Fae'
But... "any"? I need some more information about lambda I thinkwhere to find this syntax with any? where is written what you told about evaluation? Thank you very much Il giorno mercoledì 19 aprile 2017 17:30:06 UTC+2, Anthony ha scritto: > > First, when using auth.requires(), it is best to p

[web2py] Re: use case: user login on android

2017-04-20 Thread Oasis Agano
Can someone share the code on the controller side of authentication inside web2py and how to make co exist with the default authentication. Thanks, Oasis On Tuesday, April 18, 2017 at 12:31:38 AM UTC+2, Dave S wrote: > > > > On Monday, April 17, 2017 at 1:20:20 PM UTC-7, Oasis Agano wrote: >> >>

Re: [web2py] Re: @auth.requires for functions

2017-04-20 Thread Marvi Benedet
https://docs.python.org/2/library/functions.html#any def any(iterable): for element in iterable: if element: return True return False so any() return true if one (or more) of the elements is True. this: auth.has_membership(role) for role in list_of_roles try all th

Re: [web2py] Re: @auth.requires for functions

2017-04-20 Thread Andrea Fae'
Thanks Il giorno giovedì 20 aprile 2017 15:40:33 UTC+2, Marvix ha scritto: > > https://docs.python.org/2/library/functions.html#any > > def any(iterable): > for element in iterable: > if element: > return True > return False > > so any() return true if one (or more) of

Re: [web2py] Re: Make web2py update tables schemas auto

2017-04-20 Thread Áureo Dias Neto
In fact, I migrated my application from sqlite to mysql .. -- 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 subsc

[web2py] Image in grid

2017-04-20 Thread Gael Princivalle
Hello. Is there a way to display an image in a grid? Model: db.define_table('schemes', Field('name', type='string', requires=IS_NOT_EMPTY()), Field('description', type='string'), Field('image_file', 'upload')) Thanks. -- Resources: - http://w

Re: [web2py] Re: Make web2py update tables schemas auto

2017-04-20 Thread Anthony
On Thursday, April 20, 2017 at 6:49:06 AM UTC-4, Áureo Dias Neto wrote: > > Yes, I'm working with legacy tables that were already existing in MySql > before you hooked your application to that databases, and I added fields to > my models, and this not reflect on the db > If you never used web2py

[web2py] Re: @auth.requires for functions

2017-04-20 Thread Anthony
On Thursday, April 20, 2017 at 8:36:46 AM UTC-4, Andrea Fae' wrote: > > But... "any"? I need some more information about lambda I thinkwhere > to find this syntax with any? > where is written what you told about evaluation? > Remember, web2py is a Python framework -- many of the things you se

Re: [web2py] Re: Make web2py update tables schemas auto

2017-04-20 Thread Áureo Dias Neto
The problem was that I actually modified the sql to migrate the database, because some fields CHAR (512) from sqlite, I had to switch to TEXT in mysql I'm going to hold a fake_migration .. Thank you Anthony. 2017-04-20 11:06 GMT-03:00 Anthony : > On Thursday, April 20, 2017 at 6:49:06 AM UTC-4,

Re: [web2py] Re: Using validate_and_insert with a computed field

2017-04-20 Thread Anthony
On Wednesday, April 19, 2017 at 7:50:46 PM UTC-4, Chris wrote: > > Uh oh...I just removed requires from the computed field and reran my unit > tests, and now validate_and_insert inserts but the computed field isn't > calculated at all! I tried insert and it does the computation. > > Is there some

[web2py] Re: @auth.requires for functions

2017-04-20 Thread Andrea Fae'
Hello, if I have to get the list from database, where I need to put the code? At the start of default.py where I use the functions? Thanks Il giorno mercoledì 19 aprile 2017 17:30:06 UTC+2, Anthony ha scritto: > > First, when using auth.requires(), it is best to put the test inside a > lambda (o

[web2py] Re: use case: user login on android

2017-04-20 Thread Dave S
On Thursday, April 20, 2017 at 6:30:15 AM UTC-7, Oasis Agano wrote: > > Can someone share the code on the controller side of authentication inside > web2py and how to make co exist with the default authentication. > > The web2py side can be handled with a decorator if Basic Auth is sufficient;

[web2py] Re: Saving User bandwidth consumed

2017-04-20 Thread Dave S
On Thursday, April 20, 2017 at 3:02:49 AM UTC-7, Sharjeel Ali Shaukat wrote: > > Please help regarding bandwidth , how user usage of bandwidth should taken > from web2py application , application requirement is to check the bandwidth > size consumed per logged in user > This seems like someth

[web2py] Re: Returning a token for Android app authentication

2017-04-20 Thread Dave S
On Thursday, April 20, 2017 at 2:57:44 AM UTC-7, Oasis Agano wrote: > > > The only challenge im facing is the needed customization on the W2P side > to allow the the app to login, and the route to use inside the mobile app > to pass the login credentials. > If someone can share a segment of the

[web2py] Date selector doesn't display properly after changing layout(see screenshot).What can be the reason?

2017-04-20 Thread Mike Stephenson
Any idea on what must be wrong in any of the external css file in the layout. What I should do to rectify this? -- 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

[web2py] Re: use case: user login on android

2017-04-20 Thread Oasis Agano
Thank you for the reply, does basic auth return a token? it seems that basic auth works on that time but isnt persistent, i mean if i try to open another link requiring authentication i get redirected to the login. in a git repo of an android app using w2p as a server i saw the guy connected

[web2py] Re: Image in grid

2017-04-20 Thread 黄祥
*pls try :* def schemes(): table = db.schemes links = [dict(header = T('Image'), body = lambda row_field: \ DIV(A(IMG(_src = URL('default', 'download', args = row_field), _width = 150, _height = 100), _href = URL('default', 'download', args = row_field) ) if row_field else '' ) ) ] grid = SQLF

Re: [web2py] Re: Using validate_and_insert with a computed field

2017-04-20 Thread Anthony
I'm not sure if this is the cause of your problem, but I just posted an issue: https://github.com/web2py/pydal/issues/462 Anthony On Thursday, April 20, 2017 at 10:30:14 AM UTC-4, Anthony wrote: > > On Wednesday, April 19, 2017 at 7:50:46 PM UTC-4, Chris wrote: >> >> Uh oh...I just removed requi

Re: [web2py] Re: Using validate_and_insert with a computed field

2017-04-20 Thread Chris
Thanks for the update! I'm passing all of the fields needed by the compute function. It looks something like this: dct_new_user = { fields here } # new_user = db.auth_user.insert(**dct_new_user) new_user = db.auth_user.validate_and_insert(**dct_new_user) The former calcu

Re: [web2py] Re: Using validate_and_insert with a computed field

2017-04-20 Thread Anthony
Need to see the fields. -- 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 Groups "web2py

[web2py] Re: how to reset_password_key programmatically?

2017-04-20 Thread lucas
ok, this is what I figured out from the source code under gluon.tools. I have a form with a nonSQLFORM input that allows the Manager to optionally force the user to reset the password. if that form is submitted correctly, under the form.process().accepted I have: rv = request.v