[ZODB-Dev] What causes a persistent object to be "broken"?

Dieter Maurer dieter at handshake.de
Thu Mar 3 13:57:15 EST 2005


kw wrote at 2005-3-2 21:25 -0800:
>I'm using a PersistentMapping and have noticed that
>one of the mappings shows the following, after
>creating and committing a one item mapping:
>
>{u'test_system': <persistent broken __main__.System
>instance '\x00\x00\x00\x00\x00\x00\x00\x1a'>}
>
>Here __main__.System is a custom datatype that's a
>composite of smaller objects, that are themselves
>persistent.

Almost surely, "__main__" no longer defines "System".

Note that "__main__" depends on the script you are calling.

It is usually not a good idea to define persitent classes in
the main module.

-- 
Dieter


More information about the ZODB-Dev mailing list