Hi Anthony,

thanks for your replay.


On 17/11/2018 16:01, Anthony wrote:
What do you mean by "returns None"? I do not think the function env() can return None, so where are you seeing None?

I see the string None in the browser when I try to access the controller. I guess the code exits in this[*] line, because for some reason a RestrictedError is raised

[*] https://github.com/web2py/web2py/blob/d7624b95f8beef0ac9e07fcf443a5a0d99f0d953/gluon/shell.py#L176

But the same code run by command line works perfectly and load the other environment in the variable.

Presumably there is some code you are not showing, as the code below creates an environment but then simply returns an empty dictionary.

No other code... I tested the call exits before I can use the new environment in my other_env variable


Note, if you want to run models, you need to specify env(..., import_models=True).


That's what I've done ;)

Thanks again
Cheers
    Manuele

--
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to