[Zope-dev] Recursive Folder creation error
Jason Spisak
444@hiretechs.com
Tue, 17 Oct 2000 07:21:10 -0700
Zopists,
I tried the example given by Kapil Thangavelu.
from OFS import Folder
def create_folders(self, number):
''' create a set of recursive folders with depth equal to number'''
parent = self
for index in xrange(number):
folder = Folder()
folder.id = str(number)
parent._setObject(folder, str(number))
parent = folder
But I get this error:
Error Type: TypeError
Error Value: call of non-function (type module)
Troubleshooting Suggestions
The URL may be incorrect.
The parameters passed to this resource may be
incorrect.
A resource that this resource relies on may be
encountering an error.
For more detailed information about the error, please refer
to the HTML source for this page.
If the error persists please contact the site maintainer.
Thank you for your patience.
Traceback (innermost last):
File /home/jason/Zope-2.2.0/lib/python/ZPublisher/Publish.py, line
222, in publish_module
File /home/jason/Zope-2.2.0/lib/python/ZPublisher/Publish.py, line
187, in publish
File /home/jason/Zope-2.2.0/lib/python/Zope/__init__.py, line 221, in
zpublisher_exception_hook
(Object: ElementWithAttributes)
File /home/jason/Zope-2.2.0/lib/python/ZPublisher/Publish.py, line
171, in publish
File /home/jason/Zope-2.2.0/lib/python/ZPublisher/mapply.py, line 160,
in mapply
(Object: create)
File /home/jason/Zope-2.2.0/lib/python/ZPublisher/Publish.py, line
112, in call_object
(Object: create)
File
/home/jason/Zope-2.2.0/lib/python/Products/ExternalMethod/ExternalMethod.py,
line 263, in __call__
(Object: create)
(Info: ((<Folder instance at 8839098>, 10), {}, (10,)))
File /home/jason/Zope-2.2.0/Extensions/Creator.py, line 7, in
create_folders
(Object: ElementWithAttributes)
TypeError: (see above)
Line 7 contains folder = Folder()
Does anyone know what is askew here?
All my best,
Jason Spisak
444@hiretehcs.com