Render a parent block.
(self, name, current)
| 173 | self.resolve_or_missing = MethodType(resolve_or_missing, self) |
| 174 | |
| 175 | def super(self, name, current): |
| 176 | """Render a parent block.""" |
| 177 | try: |
| 178 | blocks = self.blocks[name] |
| 179 | index = blocks.index(current) + 1 |
| 180 | blocks[index] |
| 181 | except LookupError: |
| 182 | return self.environment.undefined('there is no parent block ' |
| 183 | 'called %r.' % name, |
| 184 | name='super') |
| 185 | return BlockReference(name, self, blocks, index) |
| 186 | |
| 187 | def get(self, key, default=None): |
| 188 | """Returns an item from the template context, if it doesn't exist |
nothing calls this directly
no test coverage detected