If the attribute is immutable, just define it as
a 'class' variable, rather than in the constructor.


class Foo(.. ):

    newAttribute = 'hello?'

You can of course *change* it in the constructor for new
object, but all your old objects will just use the class
variable. If it's mutable.. then you need to fix it in


>>>>> "Steve" == Steve Alexander <[EMAIL PROTECTED]> writes:

    Steve> Hi folks, I have a Python Product that I'm
    Steve> developing. During the course of development, I want to add
    Steve> a new attribute. All new instances get this attribute, as
    Steve> it is defined with a default value in the constructor.

    Steve> In addition, all instances that get edited via the web get
    Steve> the attribute, as the edit-processing method is defined to
    Steve> have a default value for this attribute.

    Steve> Is there any way of interacting with the ZODB persistence
    Steve> machinery to add the default attribute to all instances as
    Steve> they are brought out of persistent storage -- so that I can
    Steve> just restart Zope, and have all of my instances updated as
    Steve> I use them ?

    Steve> I can't find the right method or whatever in the ZODB
    Steve> on-line docs, or in the source.

    Steve> Thanks for any help.

    Steve> -- Steve Alexander Software Engineer Cat-Box limited

    Steve> _______________________________________________ Zope-Dev
    Steve> maillist - [EMAIL PROTECTED]
    Steve> ** No cross
    Steve> posts or HTML encoding!  ** (Related lists -
    Steve> )

Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to