Re: Fwd: r23837 - in ATContentTypes/branches/photoimagemerge-branch: adapters interface skins/ATContentTypes
Rocky Burt <[email protected]> Tue, 23 May 2006 07:50:47 -0230
| Newsgroups | gmane.comp.web.zope.plone.archetypes.devel |
|---|---|
| Organization | ServerZen Software |
| Message-ID | <1148379638.5845.11.camel@localhost> |
On Tue, 2006-23-05 at 08:41 +0100, Martin Aspeli wrote: > Bear with me here, but I seem to remember that this doesn't work as you > may think: > > photo = zapi.queryAdapter(obj,IScalable,default=None) > > will return None if obj directly provides or its class implements the > interface. I believe the better syntax (which also avoids the import of > (soon-)deprecated zapi) is: > > photo = IScalable(obj, None) > > ... which is also easier to read. :) I thought I read someplace that the new zope3.3 local compoennt (adapter) customization stuff isn't fully realized with IScalable(obj, None) (so queryAdapter was better) but I could be mistaken. - Rocky -- Rocky Burt ServerZen Software -- http://www.serverzen.com News About The Server (blog) -- http://www.serverzen.net
signature.asc
(application/pgp-signature, 191 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQBEcuH21PysfgyHvo0RAgNBAJ4xR3Z2raxdGAH6BT2bKQuBnkFvBACdHHVB iX20GMS9DkbDZf/hZLmWIo0= =lul4 -----END PGP SIGNATURE-----