Re: [web2py] Functions in Views

2012-08-13 Thread Kevin Miller
Thank you very much Bruno. Just found out that I can return it in view. Thanks a lot for your reply. On Mon, Aug 13, 2012 at 7:48 PM, Bruno Rocha wrote: > You only can call functions that are in global scope. > > if you define function in /models/ so you can call those functions in > controller

Re: [web2py] Functions in Views

2012-08-13 Thread Bruno Rocha
You only can call functions that are in global scope. if you define function in /models/ so you can call those functions in controllers and views. If you defined in controller, so you have to return it to the view. controller/default.py --- def foo(): return "bar" d

[web2py] Functions in Views

2012-08-13 Thread Kevin Miller
Hi All, Can I call custom functions in views? Functions that I have created in my controller/default.py. Thanks. --

[web2py] functions

2011-04-13 Thread 黄祥
hi, i try to follow the advise about functions from : http://web2py.com/book/default/chapter/11#Efficiency-and-Scalability - Minimize the code in models: do not define functions there, define functions in the controllers that need them or - even better - define functions in modules, import them a

[web2py] Re: expose URL to internal web2py functions

2010-09-21 Thread mdipierro
No this is not a security measure. This is only a way to decet whether a certain http header exist and that header is usually set for Ajax calls originted from web2py componenets On Sep 21, 11:17 am, Avik Basu wrote: > I was wondering if it might be possible to limit the URL to functions > that a

[web2py] Re: expose URL to internal web2py functions

2010-09-21 Thread Avik Basu
I was wondering if it might be possible to limit the URL to functions that are called internally from web2py component calls. In the manual, there is a reference to using a decorator like: @auth.requires(request.cid) Would this be an effective safeguard? Also, is there some way to set this sinc

[web2py] Re: expose URL to internal web2py functions

2010-09-20 Thread mdipierro
If the URL is exposed and it is accessible via ajax, than it is called by the remote browser. You can only limit access with @auth.requires_login() or other auth recorator. On Sep 20, 6:48 pm, Avik Basu wrote: > I have a generic function called edit_db which allows for editing of > database reco

[web2py] expose URL to internal web2py functions

2010-09-20 Thread Avik Basu
I have a generic function called edit_db which allows for editing of database records and is useful for ajax-related form functions such as edit-in-place. The URL that is exposed is something like edit_db/tablename/row_id/fieldname?value="newvalue" I would like to make sure that this function ca