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

Diff of /pac/PACDefault/ActionRecipientList.py

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

revision 1.15 by tvon, Sun Oct 12 05:59:14 2003 UTC revision 1.16 by tvon, Tue Oct 28 20:50:13 2003 UTC
# Line 19  schema = BaseSchema + Schema(( Line 19  schema = BaseSchema + Schema((
19          ),          ),
20      LinesField('country',      LinesField('country',
21          widget=MultiSelectionWidget(label='Participating Countries',          widget=MultiSelectionWidget(label='Participating Countries',
22              description="If the Uninted States is one of the countries, select the states that will be involved in this action"),              description="Select the involved countries"),
23          vocabulary='getCountries',          vocabulary='getCountries',
24          ),          ),
25      LinesField('usState',      LinesField('usState',
# Line 58  class ActionRecipientList(TemplateMixin, Line 58  class ActionRecipientList(TemplateMixin,
58      def getUSStates(self):      def getUSStates(self):
59          result = DisplayList()          result = DisplayList()
60          try:          try:
61              props = self.portal_properties.geographic_properties.getProperty('us_states')              props = self.geographic_properties.us_states.propertyIds()
62          except:          except:
63              return DisplayList(())              return DisplayList(())
64    
65          mylist = []          mylist = []
66    
67          for item in props:          for id in props:
68              mylist.append(item.split('|'))              result.add(id, self.geographics_tool.getName('us_states', id)
   
         for item in mylist:  
             result.add(item[0], item[1])  
69    
70          return result          return result
71    
72      def getCountries(self):      def getCountries(self):
73          result = DisplayList()          result = DisplayList()
74          try:          try:
75              props = self.portal_properties.geographic_properties.getProperty('countries')              props = self.geographic_properties.countries.propertyIds()
76          except:          except:
77              return DisplayList(())              return DisplayList(())
78    
79          mylist = []          mylist = []
80    
81          for item in props:          for id in props:
82              mylist.append(item.split('|'))              result.add(id, self.geographics_tool.getName('countries', id)
   
         for item in mylist:  
             result.add(item[0], item[1])  
83    
84          return result          return result
85    

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

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