Zope ZPT Loop through database record / result field names

<tal:x define="personRS python: context.person_select(id = request.get('id'));
	       person   python: personRS[0];>
	<dl>
	<tal:loop repeat="key python: personRS.names()">
		<dt tal:content="python: key.replace('_', ' ')" />
		<dd><tal:x content="python: person[key]" /> </dd>
	</tal:loop>	
	</dl>
</tal:x>
Posted by
Snippet Viewed 1331 times.

Share your Zope ZPT code snippets:

  • Get some recognition & link back to your site.

 

Submit | Browse

Most Recent zope zpt snippets

Most Viewed