[Zope] Developing customer customizable products

Petter Holmström petter.holmstrom at abo.fi
Fri Dec 5 08:00:30 EST 2003


On pe, 2003-12-05 at 14:48, 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?
> 
> 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 found a solution to the problem:

def index_html(self, REQUEST):
  template = DTMLFile( self.private_views['view'], globals()
).__of__(self)
  return template()

Now I just have to figure out why this works... :-)

-Petter-

-- 
Petter Holmström
Civare, Åbo Akademi University
Axelia, Biskopsgatan 8, Room 339
Tel: +358 2 215 3508   GSM: +358 40 8395765 
Email: petter.holmstrom at abo.fi




More information about the Zope mailing list