Thanks Martin, I was talking about waking up a few objects to less than 100 objects from zodb, so getObject() method may be the right choice.
I considered using IZCatalogBrain, but as you mentioned, brains don't give underlying object's implementation, so I rejected to use this in my use case. Thanks, Taito On Thu, Jun 18, 2009 at 9:27 PM, Martin Aspeli <[email protected]<optilude%[email protected]> > wrote: > Taito Horiuchi wrote: > >> Hi All, >> >> Can somebody tell me what is the best practice to adapts adapters to >> cataloged objects? >> >> For example, I have ATDocument cataloged as >> Products.ZCatalog.Catalog.mybrains object. >> >> I have adapter MyAdapter which adapts ATDocument and provide IMyAdapter. >> >> To Adapt this cataloged object, I need to wake it up by using getObject() >> method like: >> >> IMyAdapter(cataloged_object.getObject()) >> >> Waking up object from zodb is not good practice so, I wonder how you guys >> do this better. >> > > ... and I forgot to add: you can always use a different adapter that adapts > IZCatalogBrain or whatever it is (see the ZCatalog code) and provides your > interface. This then needs to be able to do all its work with the > information on the catalog brain (or wake up the object). > > However, you can't get a *different* adapter depending on what the > underlying object was when it was cataloged. All brains are created equal. > > > Martin > > -- > Author of `Professional Plone Development`, a book for developers who > want to work with Plone. See http://martinaspeli.net/plone-book > > > _______________________________________________ > Product-Developers mailing list > [email protected] > http://lists.plone.org/mailman/listinfo/product-developers >
_______________________________________________ Product-Developers mailing list [email protected] http://lists.plone.org/mailman/listinfo/product-developers
