Petter Holmström wrote:
On pe, 2003-12-05 at 13:03, Peter Sabaini wrote:
I'd provide a default DTMLMethod | PageTemplate file and check for a ZODB based DTMLMethod | PageTemplate object
Sth like
def render(self, <request, args etc.>): template = getattr(self, 'customized_pt', None) if template is None: template = self.default_pt return template(<your arguments>)
^^^^ What kind of arguments are we talking about here?
These are template specific (ie. different for DTML and PageTemplates). For DTML this eg. could be: template(client=self, REQUEST=self.REQUEST, foo=bar, spam=egg) foo and spam are additional (optional) keyword args you might want to pass to the template In lib/python/OFS/DTMLMethod.py , see DTMLMethod.__call__() for details
This code:
def index_html(self, REQUEST): template = DTMLFile( 'dtml/my_dtml_file', globals() ) return template(self, REQUEST)
results in the following error message:
Error Type: AttributeError Error Value: aq_parent
I've looked in Google and found several posts about similar problems, but I have not been able to find the solution to this particular problem.
Thanks in advance,
-Petter-