On Monday, March 27, 2017 at 12:39:43 AM UTC-4, 黄祥 wrote: > > 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? >
Just to clarify, the output "db_schema_1_person.py:3(<module>)" does not indicate that a function has been called (note, "<module>" rather than a function name). I think that line just indicates that the module/file was loaded, and line #3 is the first line with any code (it just coincidentally happens to be the line where before_insert_person is defined). login_onfail is not defined at the top of a file, so its line number does not appear anywhere in the output. > *modules/test_field_constructor.py* > requires_marital_status = IS_IN_SET([('Single', current.T('Single') ), > ('Married', current.T('Married') ), > ('Divorced', current.T('Divorced') ) ], > zero = current.T('Choose One') ) > You still shouldn't do that, as the current.T object is local to a specific thread. Always use attributes of current within functions/methods inside the module. 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 Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.