[ZODB-Dev] Using Ape to map zclass property sheets

Rocky Burt rocky.burt at bricsnet.com
Tue May 13 18:47:37 EDT 2003


On Tue, 2003-05-13 at 12:12, Rocky Burt wrote:
> I've decided to try another approach.  I'm replacing ape's remainder
> serializer and gateway with my own set that writes fields as column
> names.
> 
> Going to see how far I can get with this.  Also, since I'm merely
> iterating over __dict__ I can determine (in general, with some mapping)
> what the column types should be.  So I'll be avoiding having to look at
> the ZClass makeup (opening a read-only zodb connection).


I have an interesting situation.  Take the following code:
  # obj is an instance of a ZClass
  hasattr(obj, 'propertysheets')  # returns 1
  obj.__dict__.has_key('propertysheets')  # returns 0

It seems to me that this *shouldn't* happen.  What's more, I've noticed
in Ape's remainder code merely iterates over __dict__ to determine what
to store.  If I am correct in my conclusions, this means that an
object's property sheet state (as defined by it's zclass) is being
lost/forgotton.

Of course we can put in a special check for propertysheets, but
shouldn't there be a more standard way to get back all of the attributes
that exist (which is what i thought __dict__ was supposed to be).

- Rocky





More information about the ZODB-Dev mailing list