RE: [Zope] PluggableBrains weirdness
What I do in this case is put bogus fields into the record object Select a, b, '' as new_field1, '' as new_field2 from table where yada yada The new_field1 and new_field2 are then members of the object I can do what I want with, even re-cast them as new types. I frequently do this to create lists inside the record object. -jim -----Original Message----- From: Michael Ekstrand [mailto:michael-zope@elehack.net] Sent: Monday, July 26, 2004 8:32 AM To: zope@zope.org Subject: Re: [Zope] PluggableBrains weirdness On Sunday 25 July 2004 17:12, Dieter Maurer wrote:
A well known (extremely old collector entry) misfeature of the "record" class used to implement Z SQL Method result rows: their instances do not have a "__dict__" and therefore cannot store attributes other than the result fields.
Hmm... is there a way I can bypass this? Creatively, perhaps? My class is implementing some data validation functions, and needs to have a few instance variables to keep track of its internal state. A few things are coming to mind - is there something I can do with a an inner class, a global dictionary, or something like that? Thanks, Michael _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev ) 271 North Avenue Suite 1210 New Rochelle, NY 10801 ebizQ Links Webinars http://www.ebizq.net/webinars/?campaign=exchange White Papers http://www.ebizq.net/white_papers/?campaign=exchange
On Monday 26 July 2004 09:20, Jim Kutter wrote:
Select a, b, '' as new_field1, '' as new_field2 from table where yada yada
Beautiful. It's working just fine now that I do this... The Test page in the management interface is now broken, as my additional field names start with underscores, but I can live with that for the time being. -Michael
participants (2)
-
Jim Kutter -
Michael Ekstrand