[Zope-dev] Confused by accuisition, need help
Hi there, I need the help with the following situation: I have a folder test with the following structure 1 Test a index_html some frames to structure the display a zman (a product I am about to develop) a data b projects c data acesses database c display displayes the data b documents c data acesses database c display displayes the data (I hope you can still see the structure) Now to display the records I use the following dtml-method(in the disply method): dtml-in expr="PARENTS[0].data()" OPTION selected value="dtml-var sequence-index" dtml-var sequence-item /OPTION /dtml-in This works fine if I am in projects od dicuments Now my problem: in index_html I only would like to splice the various parts togezher. Like so: some glue dtml-var expr="PARENTS[0].data.projects.show()" dtml-var expr="PARENTS[0].data.documents.show()" /some glue Unfortunatelly I get an erro in the display-methodr: Error Value: PARENTS (Object: PARENTS[0].data()) Obviously when called like this, the method knows nothing of its anchestry. How kan I call methods that are in a "lower" folder, and have them know theyr environment? Thanks for your help. Robert
Re: [Zope-dev] Confused by accuisition, need help
On Sun, Apr 08, 2001 at 11:14:51PM +0200, Robert Rottermann wrote: Hi there, I need the help with the following situation: The easiest way is to make more use of DTML and not try to bend it so much: dtml-in expr="PARENTS[0].data()" OPTION selected value="dtml-var sequence-index" dtml-var sequence-item /OPTION /dtml-in Instead, try just dtml-in data. Now my problem: in index_html I only would like to splice the various parts togezher. Like so: some glue dtml-var expr="PARENTS[0].data.projects.show()" dtml-var expr="PARENTS[0].data.documents.show()" /some glue Try this: some glue dtml-with data dtml-with projects dtml-var show /dtml-with dtml-with documents dtml-var show /dtml-with /dtml-with /some glue Or something like that. When you call stuff with "name=" instead of "expr=", you let DocumentTemplate do the calling for you, and then your methods will be called with the correct parameters. []s, |alo + -- I say a prayer now our love's departed That you'll come back to stay Bring back the perfect day http://www.laranja.org/mailto:[EMAIL PROTECTED] pgp key: http://www.laranja.org/pessoal/pgp Brazil of Darkness (RPG) --- http://www.BroDar.org/ ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )
Re: [Zope-dev] Confused by accuisition, need help
BTW - you're not confused by Acquisition, you're confused by DocumentTemplate's calling conventions (you can't call it with zero parameters, not if you want it to work anyway) []s, |alo + -- I say a prayer now our love's departed That you'll come back to stay Bring back the perfect day http://www.laranja.org/mailto:[EMAIL PROTECTED] pgp key: http://www.laranja.org/pessoal/pgp Brazil of Darkness (RPG) --- http://www.BroDar.org/ ___ Zope-Dev maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope )