Changeset 33

Show
Ignore:
Timestamp:
31/10/05 16:51:12
Author:
sjudge
Message:

Changes to schemata.py and PloneSoftwareCenter?.py to sort out problems with viewing FORGE projects - using oats_status instead of isOats...

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/OATSPSC/content/PloneSoftwareCenter.py

    r28 r33  
    7474             
    7575    security.declarePrivate('_getContained') 
    76     def _getContained(self, states, category, CatType, oats, portal_type, limit=None,  
     76    def _getContained(self, states, category, CatType, oats_status, portal_type, limit=None,  
    7777                        sort_on='effective', sort_order='reverse'): 
    7878        """Get contained objects of type portal_type 
     
    9393            else: 
    9494                query['getCategories_need'] = category 
    95         if oats: 
    96             query['isOats'] = oats 
     95 
     96        if oats_status: 
     97                query['getOats_status'] = oats_status 
     98 
    9799        if limit: 
    98100            query['sort_limit'] = limit 
     
    113115        """Get catalog brain of packages.""" 
    114116        if Forge=='Forge': 
    115             oats=1 
    116         else: 
    117             oats=None 
    118         return self._getContained(states, None, None, oats, 'PSCProject', limit) 
     117            oats_status='OATSProject' 
     118        else: 
     119            oats_status=None 
     120        return self._getContained(states, None, None, oats_status, 'PSCProject', limit) 
    119121         
    120122    security.declareProtected(CMFCorePermissions.View, 'getPackagesByCategory') 
     
    123125 
    124126        if Forge=='Forge': 
    125             oats=1 
    126         else: 
    127             oats=None 
    128         return self._getContained(states, category, CatType, oats, 'PSCProject', limit, 
     127            oats_status='OATSProject' 
     128        else: 
     129            oats_status=None 
     130        return self._getContained(states, category, CatType, oats_status, 'PSCProject', limit, 
    129131                                    sort_on='sort_title') 
    130132 
     
    138140        """Get catalog brains for releases in category.""" 
    139141        if Forge=='Forge': 
    140             oats=1 
    141         else: 
    142             oats=None 
    143              
    144         return self._getContained(states, category, CatType, oats, 'PSCRelease', limit) 
     142            oats_status='OATSProject' 
     143        else: 
     144            oats_status=None             
     145        return self._getContained(states, category, CatType, oats_status, 'PSCRelease', limit) 
    145146 
    146147    security.declareProtected(CMFCorePermissions.View, 'getCategoriesToList')  
  • trunk/OATSPSC/content/schemata.py

    r27 r33  
    372372        widget=IdWidget ( 
    373373            label="Short name", 
    374             description="Should not contain spaces, underscores or mixed case. Short Name is part of the item's web address.", 
     374            description="The Short Name is part of the item's web address, should be in CamelCase and contain no spaces- e.g. MyProject.", 
    375375            i18n_domain="plonesoftwarecenter", 
    376376        ), 
     
    447447        name='contactAddress', 
    448448        required=0, 
    449         validators = (('isMailto', V_SUFFICIENT), ('isURL', V_REQUIRED),), 
     449        validators = ('isEmail',), 
    450450        widget=StringWidget( 
    451451            label="Contact address", 
    452452            label_msgid="label_package_contact_address", 
    453             description="Contact address for the project. Use mailto: or http:// prefix to indicate an email address or webpage.", 
     453            description="Email contact for the project. ", 
    454454            description_msgid="help_package_contact_address", 
    455455            i18n_domain="plonesoftwarecenter", 
     
    561561     ),  
    562562 
     563# Probably ditch this for the multivalued version (oats_status) 
     564 
    563565   BooleanField( 
    564566        name='oats', 
    565         accessor="isOats", 
     567#        accessor="isOats", 
    566568        searchable=1, 
    567569        default=0, 
     570        index='KeywordIndex:schema', 
    568571        write_permission=CMFCorePermissions.ReviewPortalContent, 
    569572        widget=BooleanWidget( 
  • trunk/OATSPSC/version.txt

    r30 r33  
    1 1.0 beta 7 - OATS beta 29 
     11.0 beta 7 - OATS beta 33 
     2 
     3Changes to schema and plonesoftwarecentre in order to sort out viewing Forge projects... using oats_status