c1.py and c2.py are controllers.
c2 has a function f in it.
Can code in c1.py call the function f?

On Wed, May 15, 2019, 7:40 PM Dave S <snidely....@gmail.com> wrote:

>
>
> On Wednesday, May 15, 2019 at 12:44:24 PM UTC-7, Vlad wrote:
>>
>> this must be a very basic question; I just don't have full clarity on how
>> web2py handles this:
>>
>> can code in one controller somehow access a function in another
>> controller? Or I have to move such a function to model code?
>>
>
> It's not clear what you're asking.
>
>
> Consider
>
> web2py
>   \--- applications
>           |------ appX
>           \------ appY
>               | ----controllers
>               |     \-- default
>               |        |---- hiddenY0(somearg)
>               |        |---- funcY1
>               |        \---- funcY2
>               |             \---- innie1_Y2
>               \---- modules
>                     \-- calculator
>                            |---- calc1
>                            |        \--- innie_calc1
>                            \---- calc2
>
>
> I believer funcY1 can call funcY2, although the usual way to handle that
> is by redirect().
> But funcY1 cannot call innie_Y2 because of scoping.
> Both funcY1 and funcY2 can call hiddenY0, but because hiddenY0 has an arg,
> no function outside of default can access it directly, and it is not an
> endpoint for a URL (er, URI).
> Also, after import, either funcY1 or funcY2 can call either calc1 or
> calc2, but cannot call innie_calc1.
>
> (There is a special case in Python where the innie_calc1 function is
> returned by calc1 to the caller, but that puts the innie into the scope of
> the caller)
>
> Are any of those what you are asking about?  What are you trying to do?
>
> /dps
>
>
>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/LVQkZVfaoZM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/81313021-7181-4f6c-870e-24d199f47c7c%40googlegroups.com
> <https://groups.google.com/d/msgid/web2py/81313021-7181-4f6c-870e-24d199f47c7c%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CABZ%2BKCCnMy2eOhjVds6tqwW124BK34yrUoEqvGGa6T%3DYHjpFuw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to