[Zope-dev] Folder(id)

Florent Guillaume fg@nuxeo.com
Tue, 23 Jul 2002 15:51:44 +0000 (UTC)


Currently OFS.Folder.Folder doesn't have a constructor, so (I think)
defaults to that of ExtensionClass.Base which accepts anything.

The problem is that a number of places in the code, and a number of
people, expect ob=Folder(id) to create a correct folder, whereas the id
is actually not used.

Noa got bitten by this today, and a number of tests even call
Folder with an argument. Whereas the rest of the code painstakingly does
  ob = Folder()
  ob.id = id

Is anyone opposed to having a
    def __init__(id=None, title=None):
        if id is not None:    self.id = id
        if title is not None: self.title = title
in Folder ?

Florent
-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:fg@nuxeo.com