[Zope-dev] wrapping unexistent objects

Casey Duncan casey@zope.com
Mon, 2 Dec 2002 11:14:06 -0500


If you want an object to be able to handle calls to undefined methods, yo=
u'll=20
probably need to use a __getattr__ hook. They can be a little tricky to g=
et=20
right (you want to filter out names that start with "_" or "aq" or else=20
you'll be in trouble), and they don't have access to acquisition, but the=
y=20
will allow you to intercept calls to arbitrary names on an object.

__bobo_traverse__ and __before_publishing_traverse__ are hooks for URL=20
traversal inside ZPublisher. They won't work for calls made inside DTML.

-Casey

On Monday 02 December 2002 11:00 am, Maurizio Boriani wrote:
> Hi all,
>         I've a little bit tricky problem:
> How could I wrap a request of an inexistent object and handle request
> in a transparent way using a defined method? I've searched about
>  __before_publishing_traverse__ and __bobo_traverse__ but them are too =
few=20
> documented (or I didn't understand them).
>=20
> Better explain:
>         I'd like to build a generic product which permit to call undefi=
ned=20
> function with parameters using dtml as any other python script but this
> functions aren't define and will be handled by product.
>=20
> Does anyone has some suggestion/Doc about this?
>=20
> TIA,
> baux
>=20
>=20
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev@zope.org
> http://lists.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists -=20
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope )
>=20