Ken Winter wrote:
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)
This is the realm of things I don't understand well, but I think
obj.value uses a somewhat different lookup algorithm (using Acquisition)
than obj['value']. Try getattr(context, 'studentlist.htm').
--
Ian Bicking / [EMAIL PROTECTED] / http://blog.ianbicking.org
_______________________________________________
ZPT mailing list
ZPT@zope.org
http://mail.zope.org/mailman/listinfo/zpt