0

How to access view reference (and its members) when TAL is used with python namespace prefix?

For example, I got reference on records property of the current view:

<tal:block define="record view/records">

How do I achieve the same with python modifier:

<tal:block define="python: ....">
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
rook
  • 5,880
  • 4
  • 39
  • 51

1 Answers1

1

You use attribute access:

<tal:block define="python:view.records">

If records is a method, make sure to call it:

<tal:block define="python:view.records()">
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343