[Zope] Acquiring/accessing a dotted name

Andrew Athan zope_list_replies@memeplex.com
Wed, 6 Nov 2002 13:55:38 -0500


Ok, 50 minutes after I started looking I couldn't find the answer, so I
emailed the group.  51 minutes after I started looking I found the answer in
the "Advanced Scripting" area of the zope book, but not in relation to
Python (Script) objects -- rather, in relation to python: attributes in TAL.

I was trying too hard.  A simple getattr(context,'viewBasket.html')() works
just fine.

Now ... any comments on idiomatic usage?

A.


-----Original Message-----
From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Andrew
Athan
Sent: Wednesday, November 06, 2002 1:44 PM
To: Zope@Zope. Org
Subject: [Zope] Acquiring/accessing a dotted name



I have a Python (Script) object which needs to return the rendering of a
page template called 'foo.html'

return context.foo.html()

will obviously not work.  What will?

I have tried various forms of the aq_acquire() call, but context does not
seem to implement this.  Importing the Acquisition module is not
allowed--and it doesn't feel right to have to create a special security
context for it.

I must be missing something simple here, and yet it is incredibly difficult
to find the answer I need from the various documentation I've looked at.

Thanks
aathan <Andrew Athan>



_______________________________________________
Zope maillist  -  Zope@zope.org
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )