Changeset 632

Show
Ignore:
Timestamp:
02/20/07 22:33:13 (2 years ago)
Author:
sgillies
Message:

Prevent invokeFactory from accidentally assigning ids reserved for BA entities

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • PleiadesEntity/trunk/AppConfig.py

    r625 r632  
    22from Products.CMFCore.utils import getToolByName 
    33 
     4BA_MAP_IDS = ['1', '1a'] + [str(n) for n in range(2, 103)] 
     5BA_TABLE_COUNT = 13 
     6BA_ROW_COUNT = 755 
     7BA_ID_MAX = len(BA_MAP_IDS) * BA_TABLE_COUNT * BA_ROW_COUNT 
     8 
  • PleiadesEntity/trunk/Extensions/loader.py

    r617 r632  
    4040from Products.PleiadesEntity.Extensions.cooking import * 
    4141 
    42 BA_MAP_IDS = ['1', '1a'] + [str(n) for n in range(2, 103)] 
    43 BA_TABLE_COUNT = 13 
    44 BA_ROW_COUNT = 755 
    45 BA_ID_MAX = len(BA_MAP_IDS) * BA_TABLE_COUNT * BA_ROW_COUNT 
     42from Products.PleiadesEntity.config import * 
    4643 
    4744batlas_pattern = re.compile(r'batlas-(\w+)-(\w+)-(\w+)') 
  • PleiadesEntity/trunk/content/PlaceContainer.py

    r626 r632  
    105105            obid = str(id) 
    106106        else: 
    107             obid = self.generateId(prefix='') 
     107            # prevent ids in the reserved range 
     108            obid = -1 
     109            while int(obid) <= BA_ID_MAX: 
     110                obid = self.generateId(prefix='') 
    108111        args = ('Place', self, obid, RESPONSE) 
    109112        new_id = pt.constructContent(*args, **kw)