Exemplo n.º 1
0
    def available_params(self):
        """
            Merge parameter values into a dictionary of available parameters

        :param param_values: A dictionary of Query param values.
        :return: A merged dictionary of parameter names and values. Values of non-existent parameters are removed.
        """

        p = extract_params(self.sql)
        if self.params:
            shared_dict_update(p, self.params)
        return p
Exemplo n.º 2
0
    def available_params(self):
        """
            Merge parameter values into a dictionary of available parameters

        :param param_values: A dictionary of Query param values.
        :return: A merged dictionary of parameter names and values. Values of non-existent parameters are removed.
        """

        p = extract_params(self.sql)
        if self.params:
            shared_dict_update(p, self.params)
        return p
Exemplo n.º 3
0
 def test_shared_dict_update(self):
     source = {'foo': 1, 'bar': 2}
     target = {'bar': None}  # ha ha!
     self.assertEqual({'bar': 2}, shared_dict_update(target, source))
 def test_shared_dict_update(self):
     source = {'foo': 1, 'bar': 2}
     target = {'bar': None}  # ha ha!
     self.assertEqual({'bar': 2}, shared_dict_update(target, source))
Exemplo n.º 5
0
 def available_params(self):
     p = extract_params(self.sql)
     if self.params:
         shared_dict_update(p, self.params)
     return p
Exemplo n.º 6
0
 def available_params(self, param_values=None):
     p = extract_params(self.sql)
     if param_values:
         shared_dict_update(p, param_values)
     return p
Exemplo n.º 7
0
 def available_params(self, param_values=None):
     p = extract_params(self.sql)
     if param_values:
         shared_dict_update(p, param_values)
     return p
Exemplo n.º 8
0
 def test_shared_dict_update(self):
     source = {"foo": 1, "bar": 2}
     target = {"bar": None}  # ha ha!
     self.assertEqual({"bar": 2}, shared_dict_update(target, source))