[Zope-CMF] getting an object's factory

Mark McEahern mark@mceahern.com
Wed, 26 Feb 2003 06:58:33 -0600

Suppose I have a portal object and I want to serialize (to disk) the minimum
amount of information I need to create another one.  I'm currently doing

  # Store type_name on disk.
  type_name = item.getTypeInfo().Title()


  # later, I can create an instance...
  parent.invokeFactory(type_name=type_name, id=new_id)

Is the fact that this currently works coincidental?  Is there a clearer
approach?  I'm purposefully not spelling out more of the approach because I
assume it's irrelevant.  I'm probably wrong about that.  ;-)


// m