Also, if multiple apps need to share code, a better approach might be to 
put the shared code in modules and import into each app. 

On Saturday, November 17, 2018 at 10:01:24 AM UTC-5, Anthony wrote:
>
> On Friday, November 16, 2018 at 11:34:41 AM UTC-5, Manuele wrote:
>>
>> Hi! 
>>
>> Is there any good reason why thees few code lines that perfectly run on 
>> a python interpreter returns None if called in a controller? 
>>
>
> What do you mean by "returns None"? I do not think the function env() can 
> return None, so where are you seeing None? Presumably there is some code 
> you are not showing, as the code below creates an environment but then 
> simply returns an empty dictionary.
>
> Note, if you want to run models, you need to specify env(..., 
> import_models=True).
>
> Anthony
>  
>
>>
>>
>> from gluon.shell import env 
>>
>> def index(): 
>>
>>      other_env = env("my_other_application", True) 
>>
>>      return dict() 
>>
>>
>> I would like to access a complete model of another application, is it a 
>> deprecable behaviour? 
>>
>>
>> Thanks a lot 
>>
>>
>>      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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to