Re: [Zope3-Users] What attributes are made persistent

2006-02-16 Thread Jean-Marc Orliaguet
Peter Bengtsson wrote: On 2/16/06, Jeff Shell <[EMAIL PROTECTED]> wrote: One could, but it's really not worth it. It's just the laws of Python and mutability and immutability :). (It took me years to understand those terms. I kept associating them with 'mutable' in the "can be made quiet" se

Re: [Zope3-Users] What attributes are made persistent

2006-02-16 Thread Peter Bengtsson
> > - Shaun > > > > > -Original Message- > > > From: [EMAIL PROTECTED] > > [mailto:[EMAIL PROTECTED] > > > On Behalf Of Stephan Richter > > > Sent: Wednesday, February 15, 2006 8:43 AM > > > To: zope3-users@zope.org > > >

Re: [Zope3-Users] What attributes are made persistent

2006-02-16 Thread Chris Withers
Peter Bengtsson wrote: So by using PersistentList it just means that you can use: self.alist.append(1) in your code. The attribute, self.alist, is still saved even without PersistentList but it just means you have to be careful when writing to it. PersistentX classes also usually subclass Pers

Re: [Zope3-Users] What attributes are made persistent

2006-02-15 Thread Jeff Shell
nds like too much work, and would be problem prone even so. After > all, some things you don't want to be persistent! > > - Shaun > > > -Original Message- > > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > > On Behalf Of Stephan Richter &

RE: [Zope3-Users] What attributes are made persistent

2006-02-15 Thread Shaun Cutts
OTECTED] > On Behalf Of Stephan Richter > Sent: Wednesday, February 15, 2006 8:43 AM > To: zope3-users@zope.org > Cc: Florian Lindner > Subject: Re: [Zope3-Users] What attributes are made persistent > > On Wednesday 15 February 2006 08:21, Peter Bengtsson wrote: > > class

Re: [Zope3-Users] What attributes are made persistent

2006-02-15 Thread Lennart Regebro
On 2/15/06, Peter Bengtsson <[EMAIL PROTECTED]> wrote: > D'oh! That's confusing. Isn't there a class that gathers all of these in one. All of who? > It seems confusing, you derive from Persistent but only some are accepted. > Does that mean that there's PersistentFloat and PersistentTuple too? B

Re: [Zope3-Users] What attributes are made persistent

2006-02-15 Thread Peter Bengtsson
On 2/15/06, Paul Winkler <[EMAIL PROTECTED]> wrote: > On Wed, Feb 15, 2006 at 01:21:14PM +, Peter Bengtsson wrote: > > I understand the mutation stuff and I always do it like this in zope2 > > (I'm a complete beginner in the zope3 world eager to learn): > > > > def updatesometing(self): > >

Re: [Zope3-Users] What attributes are made persistent

2006-02-15 Thread Paul Winkler
On Wed, Feb 15, 2006 at 01:21:14PM +, Peter Bengtsson wrote: > I understand the mutation stuff and I always do it like this in zope2 > (I'm a complete beginner in the zope3 world eager to learn): > > def updatesometing(self): >#self.numbers['Peter'] = "0779 123 456" >numbers = self.num

Re: [Zope3-Users] What attributes are made persistent

2006-02-15 Thread Stephan Richter
On Wednesday 15 February 2006 08:21, Peter Bengtsson wrote: > class PersistentAnything(PersistentMapping, PersistentList, > PersistentDict): AA! This is so wrong! It merges two incompatible APIs: collections and mappings. The non-persistent equivalent to this is: >>> class DoEverything(set

Re: [Zope3-Users] What attributes are made persistent

2006-02-15 Thread Peter Bengtsson
-- Forwarded message -- From: Peter Bengtsson <[EMAIL PROTECTED]> To: Jeff Shell <[EMAIL PROTECTED]> Date: Wed, 15 Feb 2006 13:14:58 + Subject: Re: [Zope3-Users] What attributes are made persistent On 2/15/06, Jeff Shell <[EMAIL PROTECTED]> wrote: > On 2/1

Re: [Zope3-Users] What attributes are made persistent

2006-02-15 Thread Chris Withers
Peter Bengtsson wrote: self.queue seem is empty each time I restart Zope. That's because dictionaries are not derived from Persistent. Try PersistentDict. D'oh! That's confusing. Isn't there a class that gathers all of these in one. Urm, Peter, the rules of persistence w.r.t. mutable objects

Re: [Zope3-Users] What attributes are made persistent

2006-02-14 Thread Jeff Shell
Oh! And reference to related Persistence modules (persistent mappings, lists, BTrees): http://www.zope.org/Wikis/ZODB/FrontPage/guide/node6.html On 2/14/06, Jeff Shell <[EMAIL PROTECTED]> wrote: > On 2/14/06, Peter Bengtsson <[EMAIL PROTECTED]> wrote: > > D'oh! That's confusing. Isn't there a cla

Re: [Zope3-Users] What attributes are made persistent

2006-02-14 Thread Jeff Shell
On 2/14/06, Peter Bengtsson <[EMAIL PROTECTED]> wrote: > D'oh! That's confusing. Isn't there a class that gathers all of these in one. > > It seems confusing, you derive from Persistent but only some are accepted. > Does that mean that there's PersistentFloat and PersistentTuple too? > If not, why

Re: [Zope3-Users] What attributes are made persistent

2006-02-14 Thread Tom Dossis
Peter Bengtsson wrote: def __init__(self): self.queue = {} self.queue seem is empty each time I restart Zope. That's because dictionaries are not derived from Persistent. Try PersistentDict. D'oh! That's confusing. Isn't there a class that gathers all of these in one. It seems c

Re: [Zope3-Users] What attributes are made persistent

2006-02-14 Thread Peter Bengtsson
On 2/14/06, Lennart Regebro <[EMAIL PROTECTED]> wrote: > On 2/14/06, Florian Lindner <[EMAIL PROTECTED]> wrote: > > Hello, > > in a class derived from Persistent, which attributes are stored? All or only > > those thar are declared in the interface? > > All. > > > def __init__(self): > >

Re: [Zope3-Users] What attributes are made persistent

2006-02-14 Thread Lennart Regebro
On 2/14/06, Florian Lindner <[EMAIL PROTECTED]> wrote: > Hello, > in a class derived from Persistent, which attributes are stored? All or only > those thar are declared in the interface? All. > def __init__(self): > self.queue = {} > > > self.queue seem is empty each time I restart Zo

Re: [Zope3-Users] What attributes are made persistent

2006-02-14 Thread Gary Poster
On Feb 14, 2006, at 4:52 PM, Florian Lindner wrote: Hello, in a class derived from Persistent, which attributes are stored? All or only those thar are declared in the interface? All. def __init__(self): self.queue = {} self.queue seem is empty each time I restart Zope. Mu

[Zope3-Users] What attributes are made persistent

2006-02-14 Thread Florian Lindner
Hello, in a class derived from Persistent, which attributes are stored? All or only those thar are declared in the interface? def __init__(self): self.queue = {} self.queue seem is empty each time I restart Zope. Thanks, Florian ___ Zope