Skip to content
Closed
Prev Previous commit
Next Next commit
Coordinates.py aggregation?
  • Loading branch information
Solracion committed Jul 22, 2021
commit 225bcd0c78fe4db25b476578d2f34215132093dc
11 changes: 9 additions & 2 deletions app/coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,21 @@ def __init__(self, latitude, longitude):
self.latitude = latitude
self.longitude = longitude

def serialize(self):
class Serialize:
def serialize(self,latitude,longitude):
"""
Serializes the coordinates into a dict.

:returns: The serialized coordinates.
:rtype: dict
"""
return {"latitude": self.latitude, "longitude": self.longitude}
self.latitude=latitude
self.longitude=longitude

return {self.latitude,self.longitude}

def __str__(self):
return "lat: %s, long: %s" % (self.latitude, self.longitude)

latitude = Coordinates("latitude")
longitude= Coordinates("longitude")