Ejemplo n.º 1
0
 def serialize(self, placeholder_names, expression_attribute_values):
     split = not self.path.attribute_name
     path = substitute_names(self.path.path, placeholder_names, split=split)
     values = [
         get_value_placeholder(value, expression_attribute_values)
         for value in self.values
     ]
     condition = self.format_string.format(*values,
                                           path=path,
                                           operator=self.operator)
     if self.logical_operator:
         other_condition = self.other_condition.serialize(
             placeholder_names, expression_attribute_values)
         return '{0} {1} {2}'.format(condition, self.logical_operator,
                                     other_condition)
     return condition
Ejemplo n.º 2
0
 def serialize(self, placeholder_names, expression_attribute_values):
     return get_value_placeholder(self.value, expression_attribute_values)
Ejemplo n.º 3
0
 def _get_values(self, placeholder_names, expression_attribute_values):
     return [
         value.serialize(placeholder_names, expression_attribute_values)
         if isinstance(value, Condition) else get_value_placeholder(
             value, expression_attribute_values) for value in self.values
     ]
Ejemplo n.º 4
0
 def serialize(self, placeholder_names, expression_attribute_values):
     return get_value_placeholder(self.value, expression_attribute_values)