Changeset 35143

Show
Ignore:
Timestamp:
04/12/06 15:43:43 (3 years ago)
Author:
gracinet
Message:

Preparation for #1608: we read the proxy, but we make a new dm with
correct fields if object is None, otherwise additional kwargs to invokeFactory
won't be forwarded (CPSDefault tests catch this)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • CPSDocument/trunk/FlexibleTypeInformation.py

    r34876 r35143  
    214214 
    215215        # Init from datamodel if present, or from an empty one 
    216         # to get default values. 
     216        # to get default values. In the latter case, we have no proxy. 
    217217        dm = kw.get('datamodel') 
    218         if dm is None: 
     218        proxy = dm and dm.getProxy() 
     219        if dm is None or dm.getObject() is None: 
    219220            dm = self.getDataModel(None, context=container) 
    220221 
     
    230231                dm.set(k, v) 
    231232 
    232         dm._setObject(ob, proxy=dm.getProxy()
     233        dm._setObject(ob, proxy=proxy
    233234        dm._commit(check_perms=0) 
    234235