Hi,

If this is Python2, then you have 2 options

*Option 1: *

Write your query as - 

<ModelName>.query(<ModelName>.<Attr> == <value>, namespace = <namespace>) 

# The key here is to add the namespace keyword and a value for it in the 
query


*Option 2:*

First switch to the namespace, then run your query as normal i.e.

try:
previous_namespace = namespace_manager.get_namespace() # Get the current 
namespace and save it
namespace_manager.set_namespace(<namespace>) # Change the namespace to your 
target namespace
<ModelName>.query(<ModelName>.<Attr> == <value>) # Run your query as normal
finally:
namespace_manager.set_namespace(previous_namespace) # Reset the namespace 
back to the original


*.....* NoCommandLine *......*
*If you miss GAE Launcher, try* https://nocommandline.com
On Tuesday, March 2, 2021 at 12:24:11 AM UTC-8 
[email protected] wrote:

> We have a multi-tenant saas.  Namespaces are used to separate the data 
> between tenants
>
> Is there a way to query for data across namespaces.  
> Why do I need it? I need for internal reporting and analysis and migration 
> purposes.
>
> -- 
> Rajesh
> www.servicefolder.com 
> <https://mailtrack.io/trace/link/b124572a30d0fcbb232da692d42fb2afb5d1ae4a?url=http%3A%2F%2Fwww.servicefolder.com&userId=6615365&signature=0effb9f289a4f249>
> *Field Service Software on Google Cloud Platform and Mobile*
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/be090b3d-0faa-4c73-80ee-bc342505f087n%40googlegroups.com.

Reply via email to