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 the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/81313021-7181-4f6c-870e-24d199f47c7c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to