[Zope-dev] Namespace funkiness

Anthony Pfrunder s341625@student.uq.edu.au
Tue, 16 Nov 1999 11:28:27 +1000 (GMT+1000)


On Mon, 15 Nov 1999, Thomas Marsh wrote:

> Hi Zope-dev,
> 
> I have a dtml method, "A", that calls another dtml method, "B". Now, B
> has some <dtml-var blah> calls in it. B works fine on its own, but when A
> calls B, for some reason B cannot see blah (a property set in the root
> folder). I see this behaviour a lot. Can anyone explain it?

I *think* it is a bug somewhere.  I've noticed that if A & C were a Python
Method such that:

	A calls B and B calls c and:

	class something:
 	  def A()
	  def B()

where B is a DTML Method A needs to call B like this:

	self.B(self, x, y, z)

instead of:

	self.B(x, y, z)

If you don't do this, properties listed *as strings only* are acccessable
but other properties and functions called within B say:

	unauthorized access -- even as superuser.

or

	Resource not found

I don't know why stuffing self in twice works - it just does ;)

Cheers,

Anthony Pfrunder