need __init__.py in main folder of application too! четверг, 23 июля 2020 г. в 04:35:25 UTC+3, snide...@gmail.com:
> > > On Tuesday, July 21, 2020 at 11:41:43 PM UTC-7, AGRogers wrote: >> >> I think I'm on the latest versions of web2py and python. And i have >> problems getting modules to recompile (not sure how related that is to this >> topic). I gave up and just put all my modules in the Models folder. That >> always works for me. I'm going to need to sort that out though at some >> point. But to be clear, i am not saying there is anything wrong with >> web2py. My general knowledge is scant so it could well be me doing >> something wrong. >> >> > There's a performance impact of putting more files in the Models folder. > > /dps > > >> On Wed, 22 Jul 2020 at 16:28, Dave S <snide...@gmail.com> wrote: >> > >>> >>> On Saturday, July 18, 2020 at 2:15:13 PM UTC-7, xgp.l...@gmail.com >>> wrote: >>>> >>>> Hi, >>>> >>>> Im replicating the example from the book for better testing: >>>> >>>> ./modules/mytest.py >>>> >>>> from gluon import current >>>> >>>> def ip(): >>>> return current.request.client >>>> >>>> ./controllers/test.py >>>> >>>> from applications.mdplenus.modules.mytest import ip >>>> >>> >>> I have a function restuff() in dot/modules/restuff.py >>> >>> I use "import restuff" >>> >>> I admit that for those files I'm on python 2.7.something and several >>> bumps back on web2py versions (I've tried newer ones, just haven't needed >>> to go all in for them yet). So it's possible that something changed that >>> broke things, but I expect the regression tests Massimo has would have >>> caught it. >>> >>> web2py, unlike the newer py4web, uses a custom importer. >>> >>> >>>> def index(): >>>> return "Your ip is " + mytest.ip() >>>> >>>> >>>> * Same error: ImportError('No module named apptest.modules.mytest',) >>>> >>>> >>> /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 web...@googlegroups.com. >> >> >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/web2py/c1e19587-9ad9-40d0-9718-fb7200da3f64o%40googlegroups.com >>> >>> <https://groups.google.com/d/msgid/web2py/c1e19587-9ad9-40d0-9718-fb7200da3f64o%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- 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/9dbbaf75-7e8c-4277-a4b3-bb8550e1a1ccn%40googlegroups.com.