[mod_python] running templates, was segmentation fault

Julien Cigar jcigar at ulb.ac.be
Wed Jun 7 03:21:50 EDT 2006


Jim's right, my idea was to do a kind of "main" template container, 
something like :

<html>
<head>...</head>
<body>
<div id="container">
  <div id="header"> ... </div>
  <div id="menu"> ... </div>
  <div id="anothercommonpart"> ... </div>

  <div id="main">
    <!-- MAIN STUFF GOES HERE -->
    <%@ include file = "..." %>
  </div>

  <div id="footer">...</div>
</div>

in my example "body_template = psp.PSP(req, filename="list.psp")" whould 
be the included file and the "mytemplate.run({'body' : body_template})" 
would be the "main" template.
Both are psp.PSP() instances. I thought I could to something like :

body_template = psp.PSP(file="foobar.psp")
main = psp.PSP(file="main_template.psp")
main.run(dict(body=body_template))

and later in the "main" template and <%@ include file="<%= body %>" %>, 
but as Jim said this doesn't work ...

Julien

Jim Gallacher wrote:
> David Bear wrote:
>> On Tue, Jun 06, 2006 at 12:03:37PM -0400, Jim Gallacher wrote:
>>> As an alternative you could do:
>>>
>>> body_template = psp.PSP(req, filename="list.psp")
>>> mytemplate.run({'body' : body_template})
>>
>> this syntax baffles me. where is 'mytemplate' defined? and what kind
>> of an object is it?
>
> It's a reference to snippet of code in Julien's message. Since the 
> thread was discussing psp templates, one can assume his reference to 
> mytemplate.run() refers to a PSP instance created elsewhere in his 
> code which was not in the message but can be inferred.
>
> Jim
>
> _______________________________________________
> Mod_python mailing list
> Mod_python at modpython.org
> http://mailman.modpython.org/mailman/listinfo/mod_python
>


-- 
Julien Cigar
Belgian Biodiversity Platform
http://www.biodiversity.be
Université Libre de Bruxelles
Campus de la Plaine CP 257
Bâtiment NO, Bureau 4 N4 115C (Niveau 4)
Boulevard du Triomphe, entrée ULB 2
B-1050 Bruxelles
office: jcigar at ulb.ac.be
home: mage at mordor.ath.cx



More information about the Mod_python mailing list