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
                   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
    (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)
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
    (Object: ElementWithAttributes)
TypeError: (see above)

Line 7 contains folder = Folder()
Does anyone know what is askew here?

All my best,

Jason Spisak

Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope )

Reply via email to