Internal helper function to create a derived context. This is used in situations where the system needs a new context in the same template that is independent.
(self, locals: t.Optional[t.Dict[str, t.Any]] = None)
| 308 | ) |
| 309 | |
| 310 | def derived(self, locals: t.Optional[t.Dict[str, t.Any]] = None) -> "Context": |
| 311 | """Internal helper function to create a derived context. This is |
| 312 | used in situations where the system needs a new context in the same |
| 313 | template that is independent. |
| 314 | """ |
| 315 | context = new_context( |
| 316 | self.environment, self.name, {}, self.get_all(), True, None, locals |
| 317 | ) |
| 318 | context.eval_ctx = self.eval_ctx |
| 319 | context.blocks.update((k, list(v)) for k, v in self.blocks.items()) |
| 320 | return context |
| 321 | |
| 322 | keys = _dict_method_all(dict.keys) |
| 323 | values = _dict_method_all(dict.values) |
no test coverage detected