RE: RE: DreamWeaver files -> ZPTs: How?

"Ken Winter" <[email protected]>
Newsgroups gmane.comp.web.zope.page-templates
Message-ID <005c01c55fdb$8a2abb60$6b03a8c0@kenxp>
> -----Original Message-----
> From: Ian Bicking [mailto:[email protected]]
> Sent: Monday, May 23, 2005 4:53 PM
> To: [email protected]
> Cc: 'Chris Beaven'; [email protected]
> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.