For now, it's not possible in pure python, because the select namespace is specified by the environment variable IRISNAMESPACE, and environment variable can't be change in the parent process, I have tried by reloading iris module with no success.
To achieve that, for now, as Robert says, you have to create an helper method in objectscript ... :(
Class Embedded.Utils
{
ClassMethod GetNameSpace() As %Status
{
Return $namespace
}
ClassMethod SetNameSpace(pNameSpace) As %Status
{
zn pNameSpace
Return $namespace
}
}
But be aware to have the method SetNamespace available also the new target namespace to be able to return ! So you either map the class to Namespace %All, or name the class %ZEmbedded.Utils or similar, to make it available across all namespaces.
just do it in a classMethod in Objectscript
don't forget to return to your original namespace to find where you came from
For now, it's not possible in pure python, because the select namespace is specified by the environment variable IRISNAMESPACE, and environment variable can't be change in the parent process, I have tried by reloading iris module with no success.
To achieve that, for now, as Robert says, you have to create an helper method in objectscript ... :(
Python :
Thanks @Guillaume Rongier
But be aware to have the method SetNamespace available also the new target namespace to be able to return !
So you either map the class to Namespace %All,
or name the class %ZEmbedded.Utils or similar, to make it available across all namespaces.
About that...
Thanks Mr Robert for sharing the details
Sorry. it just turned out that sharing across namespaces doesn't (yet?) work with embedded Python
Social networks
InterSystems resources
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue
Log in or sign up
Log in or create a new account to continue