문제

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: ....">
도움이 되었습니까?

해결책

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()">
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top