On Sat, Dec 01, 2007 at 02:34:49AM +0800, Yuan HOng wrote:
> Hi,
> It seems that I can not get list attribute of an persistent object
> changed. I have the following class, which has a list as one of its
> attributes:
> class Cart(Persistent):
>     items = []
>     amount = 0

I hope that's not your actual code. Note here that items is a mutable
class attribute, so if you do this:

cart = Cart()

... you've just mutated the default list for all instances.  Is that
really what you want?  ZODB persistence can only store instance
attributes, not class attributes.

But that's irrelevant to the rest of your examples, because you
re-assigned cart.items, which should work. I don't know what's wrong


Paul Winkler
Zope3-users mailing list

Reply via email to