def _exec(self, bound_data, args, kw):
     """ doc string """
     if len(self.ctnamesplit) == 1:
         possibletemplate = self.ctnamesplit[0]
     else:
         possibletemplate = '.'.join(self.ctnamesplit[1:])
 
     if not possibletemplate.endswith('.zpt'):
         possibletemplate += '.zpt'
     base = self
     
     if hasattr(base, possibletemplate):
         request = self.REQUEST
         result = apply(getattr(base, possibletemplate), (self, request), kw)
     else:
         result = apply(PageTemplateFile._exec, (self, bound_data, args, kw))
     
     if self.optimize and OPTIMIZE:
         
         try:
             result = slimmer(result, self.optimize)
         except:
             try:
                 err_log = self.error_log
                 err_log.raising(sys.exc_info())
             except:
                 pass
             
         
     return result
    def _exec(self, bound_data, args, kw):
        """ Execute the template but first look for one instanciated
        in the ZODB based on the some filename conversion. """

        ctnamesplit = bound_data['self'].ctnamesplit
        if len(self.ctnamesplit) == 1:
            possibletemplate = ctnamesplit[0] + '.dtml'
        else:
            possibletemplate = '.'.join(ctnamesplit[1:]) + '.dtml'
            
        base = bound_data['context']

        if hasattr(base, possibletemplate):
            request = bound_data['context'].REQUEST
            params = (bound_data['context'], request)
            result = apply(getattr(base, possibletemplate), params, kw)
        else:
            result = apply(DTMLFile._exec, (self, bound_data, args, kw))
            
        if self.optimize and OPTIMIZE:
            result = slimmer(result, self.optimize)
            
        return result