[Zope] Tree tag and External Method
Pedro Silva
Pedro Silva" <pedro.silva@ruido-visual.pt
Tue, 15 Feb 2000 11:36:09 -0000
This is a multi-part message in MIME format.
------=_NextPart_000_001A_01BF77A8.DA956C60
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,
Its possible to work with the tree tag and an External Method?
What I'm trying to do is with the External Method, go get some objects =
that are in the filesystem, and with the tree I will display the tree of =
that objects.
But if I use this code:
<dtml-in obj_fs>
<dtml-tree branches_expr=3D"objectValues(['Folder', 'External =
Method'])" assume_children=3D1>
<dtml-var sequence-item>
</dtml-tree>
</dtml-in>
It will display the objects, but will repeat which on three times. Why?
If I use:
<dtml-tree branches_expr=3D"objectValues(['Folder','External =
Method'])" assume_children=3D1>
<dtml-in obj_fs>
<dtml-var sequence-item>
</dtml-in>
</dtml-tree>
If will display the objects, but which one will be repeasted six =
times!!! Why?
The code that I have in obj_fs is:
def obj_fs(self):
import os
lst=3Dos.listdir("/var/spool/news/articles/")
return lst
Can anyone explain me why is this doing that? Why isn't this working?
Another question.
I need to go get the subobjects that are in the objects that I =
referred before. I think that I will not be able to do this just with =
the tree tag, but if that is possible, how can I do that?
The result must be something like the Windows Explorer, when I click =
on the plus sign, it will display the subfolders of the object that I =
clicked.
Can anyone help me with this? Its urgent!!!
Please send your answers to psilva@ruido-visual.pt
Thanks,
Pedro
------=_NextPart_000_001A_01BF77A8.DA956C60
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2614.3500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Its possible to work with the tree tag =
and an=20
External Method?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>What I'm trying to do is with the =
External Method,=20
go get some objects that are in the filesystem, and with the tree I will =
display=20
the tree of that objects.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>But if I use this code:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> <dtml-in=20
obj_fs></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
<dtml-tree=20
branches_expr=3D"objectValues(['Folder', 'External Method'])"=20
assume_children=3D1></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =20
<dtml-var sequence-item></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =20
</dtml-tree></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
</dtml-in></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>It will display the objects, but will =
repeat which=20
on three times. Why?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>If I use:</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> <dtml-tree=20
branches_expr=3D"objectValues(['Folder','External Method'])"=20
assume_children=3D1></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
<dtml-in=20
obj_fs></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =20
<dtml-var sequence-item></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =20
</dtml-in></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
</dtml-tree></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>If will display the objects, but which =
one will be=20
repeasted six times!!! Why?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>The code that I have in obj_fs =
is:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> def =
obj_fs(self):</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
import=20
os</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =20
lst=3Dos.listdir("/var/spool/news/articles/")</FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
return=20
lst</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Can anyone explain me why is this doing =
that? Why=20
isn't this working?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Another question.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> I need to go get the =
subobjects=20
that are in the objects that I referred before. I think that I will not =
be able=20
to do this just with the tree tag, but if that is possible, how can I do =
that?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> The result must be =
something=20
like the Windows Explorer, when I click on the plus sign, it will =
display the=20
subfolders of the object that I clicked.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Can anyone help me with this? Its=20
urgent!!!</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Please send your answers to <A=20
href=3D"mailto:psilva@ruido-visual.pt">psilva@ruido-visual.pt</A></FONT><=
/DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Pedro</FONT></DIV></BODY></HTML>
------=_NextPart_000_001A_01BF77A8.DA956C60--