[Zope] Accessing properties of broken instances
Stephen Pitts
smpitts@midsouth.rr.com
Tue, 21 Dec 1999 16:17:32 -0600
--TB36FDmn/VVEgNH/
Content-Type: text/plain; charset=us-ascii
On Mon, Dec 20, 1999 at 02:31:32PM -0600, Stephen Pitts wrote:
> How can I access the properties of a broken Z-Class instance through
> DTML? I've rewritten a Z-Class inside one of my Products in Python and
> I'm trying to migrate all of the instances. I know the data is there,
> because I can export the instance to an HTML file and the properties
> show up. :-)
> --
> Stephen Pitts
> smpitts@midsouth.rr.com
> webmaster - http://www.mschess.org
>
> _______________________________________________
> Zope maillist - Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://lists.zope.org/mailman/listinfo/zope-announce
> http://lists.zope.org/mailman/listinfo/zope-dev )
>
The attached patch fixes it so that you can access properties of Broken
instances. Why is this not default behavior?
--
Stephen Pitts
smpitts@midsouth.rr.com
webmaster - http://www.mschess.org
--TB36FDmn/VVEgNH/
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="broken.patch"
--- lib/python/OFS/Uninstalled.py.old Mon Dec 20 15:34:20 1999
+++ lib/python/OFS/Uninstalled.py Tue Dec 21 11:49:47 1999
@@ -105,9 +105,7 @@
""")
def __getattr__(self, name):
- if name[:3]=='_p_':
- return BrokenClass.inheritedAttribute('__getattr__')(self, name)
- raise AttributeError, name
+ return BrokenClass.inheritedAttribute('__getattr__')(self, name)
manage=manage_main=Globals.HTMLFile('brokenEdit',globals())
manage_workspace=manage
--TB36FDmn/VVEgNH/--