Changeset 495 for trunk/Collection.py


Ignore:
Timestamp:
07/20/06 11:14:36 (13 years ago)
Author:
vahur
Message:

made a list of content types. Also made config.py accessible from python scripts and page templates.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Collection.py

    r490 r495  
    2727from Products.CMFCore.utils import getToolByName 
    2828from AccessControl import ClassSecurityInfo, Unauthorized 
    29 from config import PROJECTNAME 
     29from config import PROJECTNAME, ALL_CONTENT_TYPES, CONTENT_TYPES 
    3030 
    3131schema = BaseSchema + Schema(( 
     
    4545        relationship = 'References', 
    4646        mutator = 'addRefsToResources', 
    47         allowed_types = ('Piece', 'PresentationMaterial', 'Material','Tool','Activity'), 
     47        allowed_types = ALL_CONTENT_TYPES,  
    4848        multiValued = True, 
    4949        widget = ReferenceBrowserWidget( 
     
    160160        has_tool = 0 
    161161        for x in self.getRefsToResources(): 
    162             if x.meta_type in ['Piece', 'PresentationMaterial', 'Material', 'MultimediaMaterial']: has_content = 1 
     162            if x.meta_type in CONTENT_TYPES: has_content = 1 
    163163            if x.meta_type == 'Activity': has_act = 1 
    164164            if x.meta_type == 'Tool': has_tool = 1 
Note: See TracChangeset for help on using the changeset viewer.