示例#1
0
 def format(self):
     elems = [e.strip() for e in [
         self.street_address,
         self.postal_code,
         self.city,
         self.region,
         utils.country_name_from_code(self.country_code) \
                 if self.country_code else None
     ] if e is not None]
     return "\n".join(elems).replace(", ", "\n")
示例#2
0
 def format(self):
     elems = [
         e.strip()
         for e in [
             self.street_address,
             self.postal_code,
             self.city,
             self.region,
             utils.country_name_from_code(self.country_code) if self.country_code else None,
         ]
         if e is not None
     ]
     return "\n".join(elems).replace(", ", "\n")
示例#3
0
 def country(self):
     contact = self.primary_contact
     if contact is None or contact.country_code is None:
         return
     return utils.country_name_from_code(contact.country_code)
示例#4
0
def countrycode2name(code):
    return utils.country_name_from_code(code)
示例#5
0
 def country(self):
     contact = self.primary_contact
     if contact and contact.country_code:
         return utils.country_name_from_code(contact.country_code)
def countrycode2name(code):
    return utils.country_name_from_code(code)