Пример #1
0
 def render(self, **context):
     running_context = copy.copy(context)
     for key in running_context:
         value = running_context[key]
         if hasattr(value, "node"):
             running_context[key] = value.node
     return sqlgen.compile(
         self.node,
         self.filename,
         running_context,
         source_encoding=self.input_encoding,
         generate_unicode=self.disable_unicode is False,
         strict=self.strict,
         parameter_format=self.parameter_format,
     )
Пример #2
0
 def compile(self, node, data=None, **kwargs):
     return sqlgen.compile(node, self.fname, data or {}, **kwargs)