|
From: | Juan David Ibáñez Palomar |
Subject: | Re: [Nuxeo-localizer] Tree-Tag with LocalContent object |
Date: | Thu, 11 Jul 2002 12:26:55 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020610 Debian/1.0.0-1 |
Alexander Gräfe wrote:
On Thu, Jul 11, 2002 at 11:53:20AM +0200, Juan David Ibáñez Palomar wrote:Try to type "<dtml-var publicObjects>" with the DTML Document and within the LocalContent object. I guess "publicObjects" is a Python script, the goal is to modify it so it returns the same thing when called from a LocalContent object than when called from a DTML Document.Okay, it returns [] in the LocalContent object, and [, , , , , , , , ] in the DTML Document.If you want more help from me show me the "publicObjects" code.Here's the code: ---snip--- results=[] for object in context.objectValues(['Folder', 'DTML Document','LocalContent','DonEdukia']): results.append(object) return results ---snip---
What is different in each case is "context". I'm a bit surprised. If my Zope "zen" doesn't fails: /path/x (when x is either a DTML Document or a LocalContent object) /path (when x is a DTML Method) So it shouldn't work when it's a DTML Document, are you sure you didn't mean a DTML Method? Ok, how to solve this, many ways, one: if context.meta_type == 'LocalContent': context = context.aq_parentreturn context.objectValues(['Folder', DTML Document', 'LocalContent', 'DonEdukia')
-- J. David Ibáñez, http://www.j-david.net Software Engineer / Ingénieur Logiciel / Ingeniero de Software
[Prev in Thread] | Current Thread | [Next in Thread] |