[PEAK] ObjectWrapper subclasses always callable

PJ Eby pje at telecommunity.com
Wed May 23 15:32:12 EDT 2012


On Wed, May 23, 2012 at 2:18 PM, Marcin Tustin <marcin.tustin at gmail.com>wrote:

> I'm wrapping an object to pass to a django form, to alter how it is
> displayed in the form. Django's form rendering code has the code:
> if callable(data):
>     data = data()
>
> This breaks when passed the proxy object, because the underlying object is
> not callable.
>

Ah.  In that case, define a __call__ on your wrapper class that returns
self.  ;-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.eby-sarna.com/pipermail/peak/attachments/20120523/45cd5586/attachment.html


More information about the PEAK mailing list