Use double quotes in code snippet

Co-authored-by: sag​e <laymonage@gmail.com>
pull/12772/head
Matt Westcott 2025-01-15 17:05:42 +00:00 zatwierdzone przez Matt Westcott
rodzic 54797e3826
commit 581bb5ccd7
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -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).