Example #1
0
 def as_dict(self):
     if not self.location:
         return {"postcode": self.get_postcode_display()}
     loc = self.location
     result = {"postcode": self.get_postcode_display(), "wgs84_lon": loc[0], "wgs84_lat": loc[1]}
     if hasattr(countries, "augment_postcode"):
         countries.augment_postcode(self, result)
     return result
Example #2
0
 def as_dict(self):
     if not self.location:
         return {
             'postcode': self.get_postcode_display(),
         }
     loc = self.location
     result = {
         'postcode': self.get_postcode_display(),
         'wgs84_lon': loc[0],
         'wgs84_lat': loc[1]
     }
     if hasattr(countries, 'augment_postcode'):
         countries.augment_postcode(self, result)
     return result
Example #3
0
 def as_dict(self):
     if not self.location:
         return {
             'postcode': self.get_postcode_display(),
         }
     loc = self.location
     result = {
         'postcode': self.get_postcode_display(),
         'wgs84_lon': loc[0],
         'wgs84_lat': loc[1]
     }
     if hasattr(countries, 'augment_postcode'):
         countries.augment_postcode(self, result)
     return result