/[pac]/pac/PACDefault/PublicAction.py
ViewVC logotype

Diff of /pac/PACDefault/PublicAction.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.18 by tvon, Wed Oct 8 00:44:40 2003 UTC revision 1.19 by tvon, Sun Oct 12 02:05:46 2003 UTC
# Line 39  schema = BaseFolderSchema +  Schema(( Line 39  schema = BaseFolderSchema +  Schema((
39    
40      ###################################      ###################################
41      # Action Scope      # Action Scope
   
42      LinesField('country',      LinesField('country',
43          widget=MultiSelectionWidget(label='Participating Countries',          widget=MultiSelectionWidget(label='Participating Countries',
44              description="If the Uninted States is one of the countries, select the states that will be involved in this action"),              description="If the Uninted States is one of the countries, select the states that will be involved in this action"),
# Line 55  schema = BaseFolderSchema +  Schema(( Line 54  schema = BaseFolderSchema +  Schema((
54          ),          ),
55      ###################################      ###################################
56    
     ###################################  
     # actions  
     LinesField('allowedActions',  
         widget=MultiSelectionWidget(label='Allowed Actions',  
             description="What actions should the users be allowed to participate in."),  
         vocabulary='getAvailableActions',  
         schemata="actions",  
         ),  
     ###################################  
57      ))      ))
58    
59  class PublicAction(BaseFolder):  class PublicAction(BaseFolder):
# Line 107  class PublicAction(BaseFolder): Line 97  class PublicAction(BaseFolder):
97    
98          for item in mylist:          for item in mylist:
99              result.add(item[0], item[1])              result.add(item[0], item[1])
   
         return result  
     def getPoliticalParties(self):  
         result = DisplayList()  
         try:  
             props = self.portal_properties.pac_properties.getProperty('political_parties')  
         except:  
             return DisplayList(())  
   
         mylist = []  
   
         for item in props:  
             mylist.append(item.split('|'))  
   
         for item in mylist:  
             result.add(item[0], item[1])  
   
         return result  
   
     def getAvailableActions(self):  
         # id = label|action  
   
         result = DisplayList()  
         try:  
             props = self.portal_properties.pac_actions.propertyIds()  
         except:  
             return DisplayList(())  
   
         mylist = []  
   
         for prop_id in props:  
             if prop_id != 'title':  
                 mylist.append([prop_id, self.portal_properties.pac_actions.getProperty(prop_id).split('|')[0]])  
   
         for item in mylist:  
             result.add(item[0], item[1])  
100    
101          return result          return result
102    

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26