[Zope-dev] Question to acquisition

Thomas Riedl triedl@linuxland.de
Tue, 8 Jun 1999 16:20:28 +0200


Oh no! Not me again!

Will I make it into today's top ten troublemakers ?

>globals() casts a pretty wide net and may catch all sorts of things
>you don't want to publish.

I vaguely understand. But OTOH, leaving it out makes things croak
(like they don't find the DTML files and so on), and my understanding is
too vague to know-what-to-supply as values.

>I think that the docs describe what the first two (optional) arguments to
>a document template do:
>
>  - The first argument gets it's attributes included in the DTML namespace,
>
>  - The second argument gets it's keys included.
>
>If you provide all the necessary values via attributes of the first argument
>or via keyword arguments, then there's no need to pass a second argument.

Hm, only ITS attributes, or automagically its inheri^H^H^H^H^H^H
acquireable attributes, too?


>I wasn't paying attention to this before.  Don't do this.
>Don't put anything in an installed (ie Python) product, one 
>with a mostly closed box.

I see.


>> Leaving out standard_html_header makes everything work.
>> 
>> sipping coffee while waiting... (wobble,gurgle)
>
>The instance must be unable to acquire standard_html_header.
>You might try grabbing an instance from the Python prompt and seeing if 
>it has a standard_html_header attribute.  I assume that it doesn't.

This confronts me with a new problem:
From the Product directory I try:

tom@angua,SDB: PYTHONPATH=../..:. python ./__init__.py
Traceback (innermost last):
  File "./__init__.py", line 1, in ?
    import SDB
  File "/usr/Zope/Zope-1.10.2-src/lib/python/Products/SDB/SDB.py", line 23, in ?
    class Sdb(
  File "/usr/Zope/Zope-1.10.2-src/lib/python/Products/SDB/SDB.py", line 42, in S
db
    index_html=HTMLFile("sdb_index",_myglob_());
  File "../../Globals.py", line 216, in __init__
    elif type(_prefix) is not type(''): _prefix=package_home(_prefix)
  File "../../Globals.py", line 100, in package_home
KeyError: SD



>Also, installed products may not be helpful with acquisition.  Try  
>putting an instance in the Main Zope folder, or in a subfolder and see
>if you have the same problem.

According to your suggestions wrt our other thread I already did this.
I use something like
	TEST=HTMLFile("sdb_button", globals())
which uses a standard_html_header DTML doc in my new 'Testing' Folder:
it works, after being supplied with all its wanted parameters:
   http://......./Testing/Instance1/TEST?method=POST&action=XXX&value=YYY
gives me the results I want (plus a steel blue background from the Header
file);
calling the 'document' from within my product code still breaks.

I'm somewhat at a loss, since my insight into the relevant details
is not THAT deep (though it grows with every single of our rounds).

once again begging for help:

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