Use key().name() instead of link_id
This is now possible because key_name is constructed purely from the
key fields of an entity. It is not sufficient to use just link_id,
that works only for single-scoped entities (e.g., those that either
do not have a scope, or that have a scope which itself does not have
a scope). It would break if there was an entity that has a scoped
scope (it would only include the scope's link_id in the url, which
made it impossible to look up the scope as we missed the link_id of
the scope's scope).
Patch by: Sverre Rabbelier
#!/usr/bin/python2.5
#
# Copyright 2008 the Melange authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Set of known *current* country and territory names.
Legacy (duplicate) names for some countries have been removed from the
original list. Also missing are the following U.S. OFAC embargoed and
Commerce Department export-controlled countries:
Cuba, Iran, Myanmar (formerly Burma), North Korea, Sudan, Syria
"""
__authors__ = [
'"Todd Larsen" <tlarsen@google.com>',
]
COUNTRIES_AND_TERRITORIES = (
'Afghanistan, Islamic State of',
'Albania',
'Algeria',
'American Samoa',
'Andorra, Principality of',
'Angola',
'Anguilla',
'Antarctica',
'Antigua and Barbuda',
'Argentina',
'Armenia',
'Aruba',
'Australia',
'Austria',
'Azerbaidjan',
'Bahamas',
'Bahrain',
'Bangladesh',
'Barbados',
'Belarus',
'Belgium',
'Belize',
'Benin',
'Bermuda',
'Bhutan',
'Bolivia',
'Bosnia-Herzegovina',
'Botswana',
'Bouvet Island',
'Brazil',
'British Indian Ocean Territory',
'Brunei Darussalam',
'Bulgaria',
'Burkina Faso',
'Burundi',
'Cambodia, Kingdom of',
'Cameroon',
'Canada',
'Cape Verde',
'Cayman Islands',
'Central African Republic',
'Chad',
'Chile',
'China',
'Christmas Island',
'Cocos (Keeling) Islands',
'Colombia',
'Comoros',
'Congo',
'Congo, Democratic Republic of the',
'Cook Islands',
'Costa Rica',
'Croatia',
'Cyprus',
'Czech Republic',
'Denmark',
'Djibouti',
'Dominica',
'Dominican Republic',
'East Timor',
'Ecuador',
'Egypt',
'El Salvador',
'Equatorial Guinea',
'Eritrea',
'Estonia',
'Ethiopia',
'Falkland Islands',
'Faroe Islands',
'Fiji',
'Finland',
'France',
'French Guyana',
'French Southern Territories',
'Gabon',
'Gambia',
'Georgia',
'Germany',
'Ghana',
'Gibraltar',
'Greece',
'Greenland',
'Grenada',
'Guadeloupe (French)',
'Guam (USA)',
'Guatemala',
'Guinea',
'Guinea Bissau',
'Guyana',
'Haiti',
'Heard and McDonald Islands',
'Holy See (Vatican City State)',
'Honduras',
'Hong Kong',
'Hungary',
'Iceland',
'India',
'Indonesia',
'Iraq',
'Ireland',
'Israel',
'Italy',
"Ivory Coast (Cote D'Ivoire)",
'Jamaica',
'Japan',
'Jordan',
'Kazakhstan',
'Kenya',
'Kiribati',
'Kuwait',
'Kyrgyz Republic (Kyrgyzstan)',
'Laos',
'Latvia',
'Lebanon',
'Lesotho',
'Liberia',
'Libya',
'Liechtenstein',
'Lithuania',
'Luxembourg',
'Macau',
'Macedonia',
'Madagascar',
'Malawi',
'Malaysia',
'Maldives',
'Mali',
'Malta',
'Marshall Islands',
'Martinique (French)',
'Mauritania',
'Mauritius',
'Mayotte',
'Mexico',
'Micronesia',
'Moldavia',
'Monaco',
'Mongolia',
'Montenegro',
'Montserrat',
'Morocco',
'Mozambique',
'Namibia',
'Nauru',
'Nepal',
'Netherlands',
'Netherlands Antilles',
'New Caledonia (French)',
'New Zealand',
'Nicaragua',
'Niger',
'Nigeria',
'Niue',
'Northern Mariana Islands',
'Norway',
'Oman',
'Pakistan',
'Palau',
'Palestinian Territories',
'Panama',
'Papua New Guinea',
'Paraguay',
'Peru',
'Philippines',
'Pitcairn Island',
'Poland',
'Polynesia (French)',
'Portugal',
'Puerto Rico',
'Qatar',
'Reunion (French)',
'Romania',
'Russian Federation',
'Rwanda',
'South Georgia & South Sandwich Islands',
'Saint Helena',
'Saint Kitts & Nevis Anguilla',
'Saint Lucia',
'Saint Pierre and Miquelon',
'Saint Tome (Sao Tome) and Principe',
'Saint Vincent & Grenadines',
'Samoa',
'San Marino',
'Saudi Arabia',
'Senegal',
'Serbia',
'Seychelles',
'Sierra Leone',
'Singapore',
'Slovak Republic',
'Slovenia',
'Solomon Islands',
'Somalia',
'South Africa',
'South Korea',
'Spain',
'Sri Lanka',
'Suriname',
'Svalbard and Jan Mayen Islands',
'Swaziland',
'Sweden',
'Switzerland',
'Tadjikistan',
'Taiwan',
'Tanzania',
'Thailand',
'Togo',
'Tokelau',
'Tonga',
'Trinidad and Tobago',
'Tunisia',
'Turkey',
'Turkmenistan',
'Turks and Caicos Islands',
'Tuvalu',
'USA Minor Outlying Islands',
'Uganda',
'Ukraine',
'United Arab Emirates',
'United Kingdom',
'United States',
'Uruguay',
'Uzbekistan',
'Vanuatu',
'Venezuela',
'Vietnam',
'Virgin Islands (British)',
'Virgin Islands (USA)',
'Wallis and Futuna Islands',
'Western Sahara',
'Yemen',
'Zambia',
'Zimbabwe',
)