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 <[email protected]> wrote:

> 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"
>
> def index():
>     name = "Bruno"
>     form = FORM()
>     return dict(form=form, name=name, foo=foo)
>
> --------------------------------------
>
>
>
>
>  *Bruno Cezar Rocha** - @rochacbruno*
> [email protected] | Mobile: +55 (11) 99210-8821
> www.CursoDePython.com.br | www.rochacbruno.com.br
> Blog: Loading html elements dynamically with web2py and ajax
> <https://rochacbruno.snipt.net/loading-html-elements-dynamically-with-web2py-and-ajax/>
>   Get a signature like this.
> <http://r1.wisestamp.com/r/landing?promo=18&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_18>
>  Click
> here.<http://r1.wisestamp.com/r/landing?promo=18&dest=http%3A%2F%2Fwww.wisestamp.com%2Femail-install%3Futm_source%3Dextension%26utm_medium%3Demail%26utm_campaign%3Dpromo_18>
>
>
>
> On Mon, Aug 13, 2012 at 9:34 PM, Kevin Miller <[email protected]>wrote:
>
>>
>> Hi All,
>>
>> Can I call custom functions in views? Functions that I have created in my
>> controller/default.py.
>>
>>
>>
>> Thanks.
>>
>> --
>>
>>
>>
>>
>
>  --
>
>
>
>

-- 



Reply via email to