code: def to_json(self):
          
          return {
              'lat': self.lat,
              'lon': self.lon,
              'time': self.time.isoformat() if self.time is not None else None
          }
docs: Creates a JSON serializable representation of this instance
  
          Returns:
              :obj:`dict`: For example,
                  {
                      "lat": 9.3470298,
                      "lon": 3.79274,
                      "time": "2016-07-15T15:27:53.574110"
                  }