CORD-1010 support object __call__ to create new objs in orm
Change-Id: I912f8880dbf34ba98b4e8257d7d0d4160bcbc245
diff --git a/xos/xos_client/xosapi/orm.py b/xos/xos_client/xosapi/orm.py
index 31a20a2..0566d7f 100644
--- a/xos/xos_client/xosapi/orm.py
+++ b/xos/xos_client/xosapi/orm.py
@@ -357,6 +357,9 @@
def content_type_id(self):
return self._stub.reverse_content_type_map[self.model_name]
+ def __call__(self, *args, **kwargs):
+ return self.objects.new(*args, **kwargs)
+
class ORMStub(object):
def __init__(self, stub, package_name, invoker=None, caller_kind="grpcapi"):
self.grpc_stub = stub