[Zope-CMF] Add attributes to class which already has instances in ZODB

Rainer Thaden Rainer Thaden <thadi@gmx.de>
Thu, 9 Jan 2003 11:12:25 +0100


Hi,

let's say you've written a type-class for CMF with some attributes,
but you are not sure, if there are attributes missing. When you notice
that there are missing attributes it will be too late to change the
class, because there are already some instances in the ZODB, which you
can't assign the new attributes.
What would you do to prevent this situation when developing the class?
Is it possible to add some dummy attributes and assign them the
appropriate name afterwards like

Attribute list:
  name=''  #'normal' attributes
  birth=''
  ext1=''  #dummy attributes
  ext2=''

  and then you notice that you need an attribute for an email and
  write 

  email=ext1

  inside the class.
  
Will a call to email on the objects which are already in the ZODB
resolve the right name?
  
-- 
Regards,
 Rainer                          mailto:thadi@gmx.de