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:
parent
21d290af12
commit
f6fb743a18
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user