diff --git a/docs/topics/streamfield.md b/docs/topics/streamfield.md index 7eff6a2e1e..d0517a845d 100644 --- a/docs/topics/streamfield.md +++ b/docs/topics/streamfield.md @@ -504,10 +504,10 @@ class EventBlock(blocks.StructBlock): date = blocks.DateBlock() def get_template(self, value, context=None): - if value['date'] > datetime.date.today(): - return 'myapp/blocks/future_event.html' + if value["date"] > datetime.date.today(): + return "myapp/blocks/future_event.html" else: - return 'myapp/blocks/event.html' + return "myapp/blocks/event.html" ``` All block types, not just `StructBlock`, support the `template` property. However, for blocks that handle basic Python data types, such as `CharBlock` and `IntegerBlock`, there are some limitations on where the template will take effect. For further details, see [](boundblocks_and_values).