[mod_python] Joining template objects

Dagur Páll Ammendrup dagurp at heimsnet.is
Sat Nov 6 17:12:57 EST 2004


I have a complete beginners question for you.
Here's a stupid example but I hope it explains what I'm trying to do. 
Let's say I have this template

people.html

|<h2>
   Here is a list of people
   <%= people %>
</h2>|

Then there's another template:

person.html

|<p>
   Name: <%= name %>
   Occupation: <%= job %>
   Email <%= email %>
</p>|

Now let's say I want to use person.html on a list of several people and 
I use psp.PSP() to do it.
How can I join the objects together and put them into the single 
'people' varible for the outer 'people.html' template so I get this?


|<h2>
   Here is a list of people
   |
|<p>
   Name: John
   Occupation: programmer
   Email john at microsoft.com
</p>||

||<p>
   Name: Steven
   Occupation: Student
   Email steven at fbi.com
</p>

..etc

||</h2>

|








More information about the Mod_python mailing list