[Zope] Persistence triggering

Chris McDonough chrism@digicool.com
Tue, 7 Nov 2000 14:30:05 -0500


> But can I also do?
>
> self.list = self.list + [item]

Yes... this works because you're treating it immutably.  Although this is
likely much slower than an .append because the interpreter needs to make a
copy of self.list before tacking on your item.

You can also do:

self.list.append(item)
self._p_changed = 1

This explicitly tells the ZODB to include the object represented by self in
the current transaction.