[Zope-dev] Question to acquisition

Thomas Riedl triedl@linuxland.de
Thu, 10 Jun 1999 12:20:55 +0200


Hello Jim,

I've been able to overcome my problem, but - honestly - I still do
not understand how and why it works this and breaks that way.

Just to sum up:
I've a product, called SDB.
It has a class SDB, whose instances are publisheable (right term?).
This class inherits among others from Acquisition.Implicit.
Still using Zope-1.10.2, SuSe-5.1, "python serve.py".

I've a DTML form which I want to parameterize and return upon
python code actions, like if a 'change this' method is called, it
'returns' depending on its results an 'OK' button or a 'Go there, again!'
button; let's call it 'sdb_button.dtml'.
It also contains a line "<!--#var standard_html_header-->".

The class 'SDB' has a (callable) attribute
	TEST=HTMLFile('sdb_button', globals(),
		<some argument defaults by keywords>)

It also has some method
	def change_things(....):
		...
		return self.TEST(
			self.aq_parent, # relevant stuff
			<several arguments by keywords>
			)
Now, if I call "http://...../instance1/TEST", I get what I want.
If I call ..../instance1/change_things, I get what I want, too.

But: If I leave out the 'self.aq_parent' argument, change_things() chokes
on a key error since it doesn't know about standard_html_header.

So, I work around my problem and insert self.aq_base, but I don't
understand why TEST works without and change_things doesn't.

Any Zen to share, anyone?

Lotsa yrs

tom
--
MfG: Thomas Riedl
===========================================================================
triedl@linuxland.de, (+49 89) 99 34 12 - 11,        http://www.linuxland.de
Stefan-George-Ring 24, 81929 München