Hi,
Looking for a little advice on how to solve this.
Here is the problem:  I store an object in environ and this object has
a special __getattr__ which always returns an object.  However, this
object is *not* callable.

On a redirect, WebOb iterates over environ checking for __html__ via
hasattr (which calls __getattr__).  My object in the environ returns
an object for __html__, but again it is not callable, so an Exception
is thrown.

The object store in environ is a thirdparty MongoDB database instance.

So, is this a bug with WebOb, that is, should webob check that
__html__ is  callable?
# in webob html_escape
html = getattr(s, '__html__', None)
if html and callable(html):
   return html()

Or should I fix this in the PyMongo Database class?  Either way I have
to change or subclass a 3rd party lib.

I'm leaning towards fixing this in webob, because I have other objects
that have special __getattr__ methods.  Any advice is appreciated.

Thanks,
Chris
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to