[ZPT] RE: DreamWeaver files -> ZPTs: How?

Ken Winter ken at sunward.org
Mon May 23 17:08:15 EDT 2005


> -----Original Message-----
> From: Ian Bicking [mailto:ianb at colorstudy.com]
> Sent: Monday, May 23, 2005 4:53 PM
> To: ken at sunward.org
> Cc: 'Chris Beaven'; zpt at zope.org
> Subject: Re: [ZPT] RE: DreamWeaver files -> ZPTs: How?
> 
> Ken Winter wrote:
> > Chris -
> >
> > Thanks for your help.  At the time you sent it, I thought I didn't need
> it
> > (because I had learned how to use PUT_FACTORY to get Zope to accept .htm
> > extensions as ZPTs) - but now I do.
> >
> > And it works fine, except for the one more thing it turns out I really
> need:
> > to have DW recognize files with NO extension as HTML pages.  The reason
> I
> > need this is that Python insists on treating "mypage.html" as the "html"
> > attribute of a "mypage" object (which of course it can't find) rather
> than
> > as a reference to an object named "mypage.html".
> 
> Instead of obj.mypage.html, use obj['mypage.html']
> 
I'm afraid this doesn't work.  Here's the Python script, with the suggested
syntax in the last line:

d = [{'person_id':p.person_id,\
      'first_name':p.first_name,\
      'middle_names':p.middle_names,\
      'last_name':p.last_name}\
     for p in context.read_all_people()]
return context['studentlist.htm'](data=d)

This gets the error message:

Site Error
An error was encountered while publishing this resource.
Error Type: KeyError
Error Value: 'studentlist.htm'

The same thing happens if I rename the ZPT as 'studentlist_htm" and use this
syntax.  The only version that works is this:

return context.studentlist_htm(data=d)

...which of course gets back to the original problem: DW doesn't handle
extension-less files.  

Any suggestions?

- Thanks, Ken




More information about the ZPT mailing list