| 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', |
| 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 |
|
|