88orm
Advanced tools
| Metadata-Version: 2.1 | ||
| Name: 88orm | ||
| Version: 0.1.8.1 | ||
| Version: 0.1.8.8 | ||
| Summary: ORM Service Connector | ||
@@ -5,0 +5,0 @@ Home-page: http://pypi.python.org/pypi/88orm/ |
+17
-1
@@ -28,8 +28,18 @@ # -*- coding: utf-8 -*- | ||
| "url": "", | ||
| "auth_header": "" | ||
| "auth_header": "", | ||
| "communication": { | ||
| "method": "rest" | ||
| } | ||
| }) | ||
| ORM_SERVICE_URL = service_settings.get("url") | ||
| ORM_SERVICE_AUTH_HEADER = service_settings.get("auth_header") | ||
| ORM_SERVICE_COMMUNICATION = service_settings.get("communication") | ||
| if ORM_SERVICE_COMMUNICATION.get("method") == "rpc": | ||
| try: | ||
| from nameko.standalone.rpc import ClusterRpcProxy | ||
| except ImportError: | ||
| raise Exception('Nameko is required for using rpc.') | ||
| class ORM88(object): | ||
@@ -319,2 +329,5 @@ """ | ||
| def __request_get(self, url, payload, params=None): | ||
| if ORM_SERVICE_COMMUNICATION.get("method") == "rpc": | ||
| with ClusterRpcProxy(ORM_SERVICE_COMMUNICATION.get("conf")) as rpc: | ||
| return rpc.orm_service.query(payload) | ||
| response = requests.get(url, data=json.dumps(payload), headers={ | ||
@@ -336,2 +349,5 @@ "content-type": "application/json", | ||
| def __request_post(self, url, payload): | ||
| if ORM_SERVICE_COMMUNICATION.get("method") == "rpc": | ||
| with ClusterRpcProxy(ORM_SERVICE_COMMUNICATION.get("conf")) as rpc: | ||
| return rpc.orm_service.query(payload) | ||
| response = requests.post(url, data=json.dumps(payload), headers={ | ||
@@ -338,0 +354,0 @@ "content-type": "application/json", |
+3
-0
@@ -80,2 +80,5 @@ import json | ||
| if hasattr(self, key): | ||
| return None | ||
| attr_value = None | ||
@@ -82,0 +85,0 @@ if self._attrs.get(f"{key}_id"): |
+1
-1
| Metadata-Version: 2.1 | ||
| Name: 88orm | ||
| Version: 0.1.8.1 | ||
| Version: 0.1.8.8 | ||
| Summary: ORM Service Connector | ||
@@ -5,0 +5,0 @@ Home-page: http://pypi.python.org/pypi/88orm/ |
+1
-1
@@ -8,3 +8,3 @@ import setuptools | ||
| name="88orm", | ||
| version="0.1.8.1", | ||
| version="0.1.8.8", | ||
| author="Rimba Prayoga", | ||
@@ -11,0 +11,0 @@ author_email="rimba47prayoga@gmail.com", |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
29297
2.71%750
2.32%