Browse Source

Use double quotes in code snippet

Co-authored-by: sag​e <laymonage@gmail.com>
Matt Westcott 2 months ago
parent
commit
581bb5ccd7
1 changed files with 3 additions and 3 deletions
  1. 3 3
      docs/topics/streamfield.md

+ 3 - 3
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).