0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00

Add __html__ method to StreamValues

This allows template authors to write `{{ page.stream_field }}` in
Jinja2 templates without having to jump through HTML escaping loops.
This commit is contained in:
Tim Heap 2015-10-02 08:27:24 +10:00
parent 21d290af12
commit f6fb743a18

View File

@ -307,5 +307,8 @@ class StreamValue(collections.Sequence):
def __repr__(self):
return repr(list(self))
def __html__(self):
return self.__str__()
def __str__(self):
return self.stream_block.render(self)