Пример #1
0
 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)
Пример #2
0
 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)
Пример #3
0
 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)
Пример #4
0
 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)
Пример #5
0
 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)
Пример #6
0
 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)