kopia lustrzana https://github.com/wagtail/wagtail
Use double quotes in code snippet
Co-authored-by: sage <laymonage@gmail.com>pull/12772/head
rodzic
54797e3826
commit
581bb5ccd7
|
@ -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).
|
||||
|
|
Ładowanie…
Reference in New Issue