Hello everyone!
I have a project in a server without admin access so it's difficult for me
to debug it, I have a strange problem and I'm lost with it.
Basically my default.py has something like this:
import mymodule
def index():
value = mymodule.function()
return value
And inside modules directory I have mymodule.py, that has something like
this:
attribute = 'hello world'
def function():
return 'goodbye world'
If I run myapp/default/index the project doesn't work. Sometimes it gives
me an error ("mymodule has no object called function), and sometimes it
doesn't return anything.
But if I do this in default.py:
import mymodule
def index():
value = mymodule.attribute
return value
it works and return 'goobye world', so default detects the attribute but
not the function, why is this? Maybe I'm not building the module correctly?
I've tried to put the module inside site-packages and I've tried to import
the module with local_import and in both cases the results where indentical
(the attribute is read correctly but the function doesn't work).
I don't know what could I try so any help will be very appreciated.
Kind regards!
--
---
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].
For more options, visit https://groups.google.com/groups/opt_out.