If you really have to do it in TAL try: <div tal:define="results python:here.project(uname=username)" tal:content="python: results and results[0].project or '---' " /> -- Maciej Wisniowski