[Zope] - Next problem - looking for dtml file in the wrong place...

skip@calendar.com (Skip Montanaro) skip@calendar.com (Skip Montanaro)
Tue, 8 Dec 1998 15:48:47 -0500 (EST)


    Jim> Is this Globals.HTMLFile or DocumentTemplate.HTMLFile?

Globals.HTMLFile...

    >> As far as I can tell, I'm using the same calling conventions for
    >> HTMLFile objects as the MailHost and sample Products do.

    Jim> Not quite. If you look closely, you'll see that HTMLFile is
    Jim> used to create methods and that it's usually called with 
    Jim> globals() passed in.

Thanks for that tip.  I assumed globals() was used simply to gather a bunch
of data into a dict.  

    Jim> I think you want:

    Jim>     _show=HTMLFile('cal',globals())
    Jim>     def show(self, year, month=0):
		...
    Jim>         return self._show(self, month=month, year=year, cal=cal)

Right you are.  Works like a charm.

Thanks,

Skip