Ignore:
Timestamp:
21.07.2010 22:19:32 (22 months ago)
Author:
zmsdev
Message:

Added support for defaults of mandatory sub-objects, insert-commands and programmatic zexp import.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ZMS/trunk/_objchildren.py

    r750 r1122  
    2929# Product Imports. 
    3030import _blobfields 
     31import _fileutil 
    3132import _globals 
    3233 
     
    105106      if mandatory: 
    106107        if len(ids) == 0: 
    107           if obj_attr['type'] == '*' and type( obj_attr['keys']) is list and len( obj_attr['keys']) > 0: 
    108             obj_attr['type'] = obj_attr['keys'][0] 
    109           self.initObjChild(obj_attr['id'],0,obj_attr['type'],REQUEST) 
     108          default  = obj_attr.get('custom') 
     109          if default: 
     110            _fileutil.import_zexp(self,default,obj_attr['id'],obj_attr['id']) 
     111          else: 
     112            if obj_attr['type'] == '*' and type( obj_attr['keys']) is list and len( obj_attr['keys']) > 0: 
     113              obj_attr['type'] = obj_attr['keys'][0] 
     114            self.initObjChild(obj_attr['id'],0,obj_attr['type'],REQUEST) 
    110115      repetitive = obj_attr.get('repetitive',0)==1 
    111116      if repetitive: 
Note: See TracChangeset for help on using the changeset viewer.