def _update(self, table, where, data, **kwargs): query = Utils.format_query(where, {}) params = kwargs.get('params', {}) params.update({ self.api: '', 'sysparm_action': 'update', 'sysparm_query': query }) return self.session.post('%s/%s' % (self.instance, table), params=params, data=json.dumps(data), timeout=self.timeout, proxies=self.proxies)
def _get(self, table, meta={}, **kwargs): query = Utils.format_query(meta, kwargs.get('metaon', {})) params = kwargs.get('params', {}) params.update({ self.api: '', 'sysparm_action': 'getRecords', 'sysparm_query': query }) return self.session.get('%s/%s' % (self.instance, table), params=params, timeout=self.timeout, proxies=self.proxies)
def _get(self, table, meta={}, **kwargs): query = Utils.format_query(meta, kwargs.get('metaon', {})) params = kwargs.get('params', {}) params.update({ self.api: '', 'sysparm_action': 'getRecords', 'sysparm_query': query }) return self.session.get('%s/%s' % (self.instance, table), params=params, timeout=self.timeout)
def _update(self, table, where, data, **kwargs): query = Utils.format_query(where, {}) params = kwargs.get('params', {}) params.update({ self.api: '', 'sysparm_action': 'update', 'sysparm_query': query }) return self.session.post('%s/%s' % (self.instance, table), params=params, data=json.dumps(data), timeout=self.timeout)
def _list(self, table, meta, metaon={}, params={}, extended={}): server = self._get_proxy(table, params) return server.getKeys(__encoded_query=Utils.format_query(meta, metaon), **extended)