[web2py] Re: put function on models or modules

2017-03-26 Thread 黄祥
a, i c, my assumption is whatever showed in snakeviz result, is all the python files that executed, btw, there still odd for me, why login_onfail callback function is not showed snakeviz, wheter it's executed or defined? *an error traceback for IS_IN_DB() is :* requires_person =

Re: [web2py] Re: web2pyslices

2017-03-26 Thread Kiran Subbaraman
Agree with this - not build something for the web2pyslices - it's not going to be maintained consistently ... the current issue that web2pyslices faces anyway. This is the reason I recommended a Github based solution (combination of gists / repos, with the list of these things maintained in a

[web2py] Re: put function on models or modules

2017-03-26 Thread Anthony
> > *db_schema_1_person.py:3()* > Line 3 is the line where the before_insert_person function is *defined, *not where it is *called*. The output does not indicate the function has actually been called. > *another question is about validator* > e.g. > requires_person = IS_IN_DB(db,

[web2py] Re: put function on models or modules

2017-03-26 Thread 黄祥
ok, i tried to minimalized the scope (start from simple scratch) *1. copy welcome scaffolding app* cp -R ~/site/web2py/applications/welcome/ ~/site/web2py/applications/z *2. Run Web2py with profiler* source ~/site/bin/activate python ~/site/web2py/web2py.py --nogui --no-banner -a 'a' -i 0.0.0.0 -p

[web2py] Re: web2pyslices

2017-03-26 Thread Marlysson Silva
An approach as web2pyref would be interesting -- 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: Smartrgrid verify old value on record before update

2017-03-26 Thread Santiago Cartasegna
I wasn't sure how to obtaien the value of the Row Id which was being modified! Thanks for your answer El lunes, 20 de marzo de 2017, 13:27:07 (UTC-3), Anthony escribió: > > > def is_bigger(form): >> idUpdate = request.args(3).first >> > > What is .first supposed to do? > > >> r =

[web2py] Re: web2pyslices

2017-03-26 Thread Ben Lawrence
Please. Lets not make something. Lets just use the web2py book and each slice having a repo in GitHub. I beg you. On Saturday, March 25, 2017 at 8:39:38 AM UTC-7, Marlysson Silva wrote: > > Awesome. This is in github? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation)

[web2py] Re: Autofill a field with data from the database based on 3 other fields without submit

2017-03-26 Thread Dave S
On Sunday, March 26, 2017 at 11:01:38 AM UTC-7, Oasis Agano wrote: > > Greetings > > I have a form built with sqlfactory > > form = SQLFORM.factory( > Field('meter', requires=IS_NOT_EMPTY()), > Field('date_from', 'datetime'), > Field('date_to', 'datetime'), > Field('amt',

[web2py] Autofill a field with data from the database based on 3 other fields without submit

2017-03-26 Thread Oasis Agano
Greetings I have a form built with sqlfactory form = SQLFORM.factory( Field('meter', requires=IS_NOT_EMPTY()), Field('date_from', 'datetime'), Field('date_to', 'datetime'), Field('amt', 'float')) then i want to have a form in the view where users will access the 3 first

[web2py] Re: inner join taking too long

2017-03-26 Thread Paolo Valleri
you should check where is the bottleneck, I see three places: - select: try to print the select statement (call _select, see http://web2py.com/books/default/chapter/29/06/the-database-abstraction-layer#Generating-raw-sql) and check it on sqlite. - as_list, split it from the select - simplejson

[web2py] Re: put function on models or modules

2017-03-26 Thread Anthony
On Saturday, March 25, 2017 at 6:05:14 PM UTC-4, 黄祥 wrote: > > i mean that callback function is called when i hit the default/user login > screen > btw, your explaination about login_onfail is clear enough, but when > compare to the 2nd example, i've bit confused : > assuming the login_onfail is

[web2py] Re: Customizing Fields the lazy way

2017-03-26 Thread Joe Barnhart
That's kinda clever. I may think of that! -- Joe On Thursday, March 23, 2017 at 4:19:05 PM UTC-7, Anthony wrote: > > Note, you might as well also add 'type': 'string' to your dictionary, and > maybe 'length': 20. You can also give yourself some flexibility by creating > a function: > > def