Re: [Zope] Lost with navigation using objectValues

2000-12-13 Thread Tim Cook

Stephane Bortzmeyer wrote:

> Does it mean I have to turn all my DTML documents into DTML methods if
> I want them to call DTML methods, even if they are only content?
> 

DTML Rule of Thumb (according to Tim):
"Only use DTML Documents when you want an object to have
persistent properties. All DTML Code goes into DTML Methods."

-- Tim Cook, President --
Free Practice Management,Inc. | http://FreePM.com
Office: (901) 884-4126
Censorship: The reaction of the ignorant to freedom.

___
Zope maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope] Lost with navigation using objectValues

2000-12-13 Thread Stephane Bortzmeyer

On Wed, Dec 13, 2000 at 12:20:34PM -0600, Tim Cook wrote:

> If the calling code is within a DTML Document, then yes. The DTML
> Method is within the calling namespace. 

OK, I understand, now, the ZopeBook was far from clear on this
example.

> You would need to set up the correct namespace first using
> dtml-with or PARENTS[x] where x is the proper namespace level of
> the aquisition tree (Jim Fulton is probably either laughing or

Peter Bengston sent me the proper syntax:

  

and it works (with DTML documents, of course). Many thanks to all,
this is user support.



___
Zope maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope] Lost with navigation using objectValues

2000-12-13 Thread Stephane Bortzmeyer

On Wed, Dec 13, 2000 at 11:31:34AM -0600, Tim Cook wrote:

> Are you sure you put it in a DTML Method and not a DTML Document?

OK, I get you: my code is in a DTML method but it was ultimately
called by DTML documents, which produced the wrong result. If I create
a DTML method, it works. After reading the excellent "DTML documents
vs DTML methods" HOWTO, it makes sense but it is quite surprising.

Does it mean I have to turn all my DTML documents into DTML methods if
I want them to call DTML methods, even if they are only content?


___
Zope maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope] Lost with navigation using objectValues

2000-12-13 Thread Tim Cook

Stephane Bortzmeyer wrote:

> Could it be an error in the calling code? I just say:
> 
> 
>

If the calling code is within a DTML Document, then yes. The DTML
Method is within the calling namespace. 
You would need to set up the correct namespace first using
dtml-with or PARENTS[x] where x is the proper namespace level of
the aquisition tree (Jim Fulton is probably either laughing or
choking at my description but it works for those of us still
struggling ).

> [That's a problem I often have with Zope. Things which seems very
> basic suddenly become blocking problems.]

It's just that aq_ thing. :-)

-- Tim Cook, President --
Free Practice Management,Inc. | http://FreePM.com
Office: (901) 884-4126
Censorship: The reaction of the ignorant to freedom.

___
Zope maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope] Lost with navigation using objectValues

2000-12-13 Thread Stephane Bortzmeyer

On Wed, Dec 13, 2000 at 11:31:34AM -0600, Tim Cook wrote:

> Are you sure you put it in a DTML Method and not a DTML Document?

Well, viewing the object through the management interface says so. To
be sure, I created a new object from scratch and changed the
standard_html_header to use it. Same problem.

Could it be an error in the calling code? I just say:



[That's a problem I often have with Zope. Things which seems very
basic suddenly become blocking problems.]



___
Zope maillist  -  [EMAIL PROTECTED]
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 )




Re: [Zope] Lost with navigation using objectValues

2000-12-13 Thread Tim Cook

Stephane Bortzmeyer wrote:


> my code, in a DTML method in the root folder:

Are you sure you put it in a DTML Method and not a DTML Document?
The code looks fine. 

 
> If I call it from /index_html, it works fine. If I call it from any
> other document anywhere, I just get  (so I'm sure the method
> has been called) but nothing else as if objectValues sent nothing (no
> need to say that I *have* subfolders an I also tried without the
> 'Folder' restriction, with the same result).

This leads me to believe that it's in a DTML Document. It is
looking in the current documents namespace and not in the root
folder namespace.

HTH,
-- Tim Cook, President --
Free Practice Management,Inc. | http://FreePM.com
Office: (901) 884-4126
Censorship: The reaction of the ignorant to freedom.

___
Zope maillist  -  [EMAIL PROTECTED]
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 )




[Zope] Lost with navigation using objectValues

2000-12-13 Thread Stephane Bortzmeyer

I just try to automatically get a list of subfolders, following the
example in the ZopeBook
. Here is
my code, in a DTML method in the root folder:


  


  


If I call it from /index_html, it works fine. If I call it from any
other document anywhere, I just get  (so I'm sure the method
has been called) but nothing else as if objectValues sent nothing (no
need to say that I *have* subfolders an I also tried without the
'Folder' restriction, with the same result).

Any advice? Zope RPM 2.2.2 on RedHat 6.2.

 Zope version: Zope 2.2.2 (source release, python 1.5.2, linux2) 
 Python version: 1.5.2 (#1, Feb 1 2000, 16:32:16) [GCC
 egcs-2.91.66 19990314/Linux (egcs- 
 System Platform: linux-i386 
 Process ID: 17906 (4101) 
 Running for: 2 hours 55 min 45 sec 




___
Zope maillist  -  [EMAIL PROTECTED]
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 )