Jinja Context¶
miniset.jinja_context
¶
JinjaTemplateProcessor(*, param_style='format', identifier_quote_character='"', env=None)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
param_style |
ParamStyleType
|
Parameter style. Defaults to "format". |
'format'
|
identifier_quote_character |
IdentifierQuoteCharacterType
|
Identifier for quote character. Defaults to '"'. |
'"'
|
env |
Optional[Environment]
|
Jinja2 environment. Defaults to None. |
None
|
Source code in miniset/jinja_context.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|
prepare_query(query, **kwargs)
¶
Prepare a query template
Parameters:
Name | Type | Description | Default |
---|---|---|---|
query |
Union[str, Template]
|
A query string/template |
required |
Returns:
Name | Type | Description |
---|---|---|
query |
str
|
A prepared query |
bind_params |
Union[List[Any], Dict[str, Any]]
|
Bind params |
Source code in miniset/jinja_context.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
|
set_context(**kwargs)
¶
Set Jinja2 context
Source code in miniset/jinja_context.py
128 129 130 |
|