Changeset 1084 for ZMS/trunk/_zcatalogmanager.py
- Timestamp:
- 05.07.2010 21:26:11 (23 months ago)
- File:
-
- 1 edited
-
ZMS/trunk/_zcatalogmanager.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ZMS/trunk/_zcatalogmanager.py
r1047 r1084 128 128 cat_id = 'catalog_%s'%lang 129 129 obs = filter( lambda x: x.id==cat_id, context.objectValues( [ 'ZCatalog'])) 130 if len(obs) == 0: 131 catalog = getattr( self, cat_id, None) 132 if catalog is not None and catalog.meta_type == 'ZCatalog': 133 obs = [catalog] 134 if len(obs) == 0: 135 return self.recreateCatalog(lang) 136 return obs[0] 130 if obs: 131 return obs[0] 132 else: 133 return getattr( self, cat_id, None) 137 134 138 135 … … 503 500 504 501 #-- Get catalog 505 cat_id = 'catalog_%s'%lang 506 obs = filter( lambda x: x.id==cat_id, context.objectValues( [ 'ZCatalog'])) 507 if len(obs) == 0: 508 catalog = getattr( self, cat_id, None) 509 if catalog is not None and catalog.meta_type == 'ZCatalog': 510 obs = [catalog] 511 if len( obs) == 0: 502 zcatalog = getCatalog( self, lang) 503 if zcatalog is None: 504 cat_id = 'catalog_%s'%lang 512 505 cat_title = 'Default catalog' 513 506 vocab_id = 'create_default_catalog_' 514 507 zcatalog = ZCatalog.ZCatalog(cat_id, cat_title, vocab_id, context) 515 508 context._setObject(zcatalog.id, zcatalog) 516 zcatalog = getCatalog(self,lang) 517 else: 518 zcatalog = obs[ 0] 509 zcatalog = getCatalog( self, lang) 519 510 520 511 #-- Add lexicon … … 689 680 lang = REQUEST['lang'] 690 681 zcatalog = getCatalog(self,lang) 682 if zcatalog is None: 683 return rtn 691 684 items = [] 692 685 for zcindex in zcatalog.indexes():
Note: See TracChangeset
for help on using the changeset viewer.
