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?
web2py
\--- applications
|------ appX
\------ appY
| ----controllers
| \-- default
| |---- hiddenY0(somearg)
| |---- funcY1
| \---- funcY2
| \---- innie1_Y2
\---- modules
\-- calculator
|---- calc1
| \--- innie_calc1
\---- calc2
--
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+un...@googlegroups.com.
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.
c1.py and c2.py are controllers.c2 has a function f in it.Can code in c1.py call the function f?
--
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+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/2c0c9fd4-9c54-4e81-adec-5fa16ebec737%40googlegroups.com.
--
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+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/web2py/1c6083f8-0d81-41dd-a83b-b1c8c40b59ee%40googlegroups.com.
web2py is so amazingly great that the only excuse to come up with web3py is if it's going to be much better than web2py, if such a thing is possible:)
On Thu, May 16, 2019 at 11:35 AM Massimo Di Pierro <massimo....@gmail.com> wrote:
This is why we are making web3py. controllers are not regular modules in web2py.--
On Wednesday, 15 May 2019 18:35:41 UTC-7, Dave S wrote:
On Wednesday, May 15, 2019 at 4:45:17 PM UTC-7, Vlad wrote:c1.py and c2.py are controllers.c2 has a function f in it.Can code in c1.py call the function f?
If f is a function in the URL sense (that is, it is top level in c2.py, and has no arguments, and the URL /.../appY/c2/f makes sense) you can redirect to it. I do not know, and have never tried, to call f directly, but the py-dotted notation c2.f might maybe work, imports done correctly.
If f has arguments and isn't an endpoint, then it could be in a file module/m1.py, and imported by c1 and c2, or the might-maybe could be in play.
That would depend, I suppose, on how the custom importer works. It is known to work for modules.
/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+unsubscribe@googlegroups.com.