Sorry my naive question, i am a zope newbie. According to the zope manual, i should get a file list of the current folder, using the dtml method: <dtml-var standard_html_header> <h2><dtml-var title_or_id> <dtml-var document_title></h2> <ul>Files <dtml-in expr="objectValues('File')"> <li><dtml-var id></li> </dtml-in> </ul> </p> <dtml-var standard_html_footer> but i get a blank page, header and footer only are displayed, even though there are files in folder (a page refresh has been done, to be safe) I am using Zope 2.5.1 So, my first question is: what is wrong in the above code? My second question: can one provide a simple code to all objects included into a folder? thank you -- max
Hi Max, the code is correct ! questions: sure that you have to used a dtml-method (not a dtml-document)? sure that you have to dtml-method in the same folder ? sure that you have meta_types = 'File' (not 'ExtFile' or 'EasyFile') in your folder ? Regards, Dirk mediaweb@linfe.it schrieb:
Sorry my naive question, i am a zope newbie.
According to the zope manual, i should get a file list of the current folder, using the dtml method:
<dtml-var standard_html_header> <h2><dtml-var title_or_id> <dtml-var document_title></h2> <ul>Files <dtml-in expr="objectValues('File')"> <li><dtml-var id></li> </dtml-in> </ul> </p> <dtml-var standard_html_footer>
but i get a blank page, header and footer only are displayed, even though there are files in folder (a page refresh has been done, to be safe)
I am using Zope 2.5.1
So, my first question is: what is wrong in the above code?
My second question: can one provide a simple code to all objects included into a folder?
thank you
-- max
_______________________________________________ Zope maillist - Zope@zope.org 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 )
From Dirk Datzert, Sat Jun 01, at 10:47: .sure that you have to used a dtml-method (not a dtml-document)?
Yes, it is a dtml method If i replace 'File' with 'Folder' in my code, i properly get the list of folders .sure that you have to dtml-method in the same folder ? i am not sure about what you mean .sure that you have meta_types = 'File' (not 'ExtFile' or 'EasyFile') in .your folder ? i added a 'File' from the ADD pull down, just to make me sure; that file is not displayed even Is there a code to list all the objects contained in a folder? thank you -- max
mediaweb@linfe.it schrieb:
From Dirk Datzert, Sat Jun 01, at 10:47: .sure that you have to used a dtml-method (not a dtml-document)?
Yes, it is a dtml method If i replace 'File' with 'Folder' in my code, i properly get the list of folders
try: <dtml-in "aq_parent.objectValues('File')"> <li><dtml-var id></li> </dtml-in> if you now get the result you expect than once again: you have a dtml-document instead of a dtml-method ?
.sure that you have meta_types = 'File' (not 'ExtFile' or 'EasyFile') in .your folder ?
i added a 'File' from the ADD pull down, just to make me sure; that file is not displayed even
Is there a code to list all the objects contained in a folder?
As the definition of objectValues in lib/python/OFS/ObjectManager.py says def objectValues(self, spec=None): # Returns a list of actual subobjects of the current object. # If 'spec' is specified, returns only objects whose meta_type # match 'spec'. return map(self._getOb, self.objectIds(spec)) you can leave out spec ('File' in your example) and do the following: <dtml-in "objectValues()"> <li><dtml-var id></li> </dtml-in>
thank you
-- max
From Dirk Datzert, Sat Jun 01, at 12:38: .try: . . <dtml-in "aq_parent.objectValues('File')"> . <li><dtml-var id></li> . </dtml-in> .
nothing displayed, besides header and footer . def objectValues(self, spec=None): . # Returns a list of actual subobjects of the current object. . # If 'spec' is specified, returns only objects whose meta_type . # match 'spec'. . return map(self._getOb, self.objectIds(spec)) . everything seems to be in the list out, files created by ADD -> File sequence are included. Should i conclude that objects created by ADD->File sequence are not File objects? thank you -- Max
mediaweb@linfe.it schrieb:
From Dirk Datzert, Sat Jun 01, at 12:38: .try: . . <dtml-in "aq_parent.objectValues('File')"> . <li><dtml-var id></li> . </dtml-in> .
nothing displayed, besides header and footer
. def objectValues(self, spec=None): . # Returns a list of actual subobjects of the current object. . # If 'spec' is specified, returns only objects whose meta_type . # match 'spec'. . return map(self._getOb, self.objectIds(spec)) .
everything seems to be in the list out, files created by ADD -> File sequence are included.
Should i conclude that objects created by ADD->File sequence are not File objects?
I think so. You use the term 'File sequence'. Do you mean an object of type 'file' or an object of type 'file sequence' which I don't know ? Try to search via search dialog and select only the meta-type 'File'. Is your file sequence been found ?
thank you
-- Max
From Dirk Datzert, Sat Jun 01, at 14:59: .> Should i conclude that objects created by ADD->File sequence are not File objects? .I think so. You use the term 'File sequence'. Do you mean an object of .type 'file' or an .object of type 'file sequence' which I don't know ?
sorry, i meant File object, created through a 'ADD, File' sequence of operations thank you anyway -- Max
From Web application Wizards, Sat Jun 01, at 14:58: .>From Dirk Datzert, Sat Jun 01, at 14:59: . .> Should i conclude that objects created by ADD->File sequence are not File objects? . .I think so. You use the term 'File sequence'. Do you mean an object of . .type 'file' or an . .object of type 'file sequence' which I don't know ? .sorry, i meant File object, created through a 'ADD, File' sequence of operations .
I am wondering which type of object is 'File' Could you please improve yor code: def objectValues(self, spec=None): # Returns a list of actual subobjects of the current object. # If 'spec' is specified, returns only objects whose meta_type # match 'spec'. return map(self._getOb, self.objectIds(spec)) so as to print out for each item its relevant object type? thank you -- Paolo
Are you sure there objects of type 'File' in the folder? A 'File' is a specific meta-type and is differentiated from 'Folder,, 'Document', and so forth. You might remove the filter (the 'Files' parameter to objectValues) and see what you get... On Sat, 1 Jun 2002 mediaweb@linfe.it wrote:
Sorry my naive question, i am a zope newbie.
According to the zope manual, i should get a file list of the current folder, using the dtml method:
<dtml-var standard_html_header> <h2><dtml-var title_or_id> <dtml-var document_title></h2> <ul>Files <dtml-in expr="objectValues('File')"> <li><dtml-var id></li> </dtml-in> </ul> </p> <dtml-var standard_html_footer>
but i get a blank page, header and footer only are displayed, even though there are files in folder (a page refresh has been done, to be safe)
I am using Zope 2.5.1
From Dennis Allison, Sat Jun 01, at 8:09: .Are you sure there objects of type 'File' in the folder? A 'File' .is a specific meta-type and is differentiated from 'Folder,,
i am supposing File objects can be created through the 'ADD, File' sequence of operations. Is that correct? thank you -- Paolo Max
participants (4)
-
Dennis Allison -
Dirk Datzert -
mediaweb@linfe.it -
Web application Wizards