The above example only works if your tasks are entirely standard tasks. You do not add extra context here, for example.
Let's make a more realistic example. Assume we want to add a page title to the template. In the functional view, this would work like this - with just one additional line:
def cr...