Chris Withers wrote:

Well, in 2.8, new behaviour is expected, right?
I really passionately believe that we should not be returnining None in Zope 2.8, and since 2.8 hasn't quite hit beta yet I'm very keen to see it fixed asap.


Any objections?

Most of my queries, where I need to wake up objects, has the form::

    brains = catalog(portal_type='Document')
    objects = []
    for brain in brains:
        try:
            obj = brain.getObject()
            if not obj is None:
                objects.append(obj)
        except:
            pass

So it will not break any of my code, and I guess that most do something
similar.



Another thing is that I think that this pattern is so common that the
catalog should have a query method where brains are automatically
converted to objects. Like:

    objects = catalog.getObjects(portal_type='Document')

That would be a handy time saver.

--

hilsen/regards Max M, Denmark

http://www.mxm.dk/
IT's Mad Science

_______________________________________________
Zope-Dev maillist - Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )

Reply via email to