def get_city_object_by_id(self, cityId):
     """
     Returns a City object filtered by the id
     """
     city = self.city_collection.find_one({'id': cityId})
     city_obj = util.deserialize_model(city, City)
     return city_obj
Beispiel #2
0
    def from_dict(cls, dikt) -> 'City':
        """Returns the dict as a model

        :param dikt: A dict.
        :type: dict
        :return: The City of this City.  # noqa: E501
        :rtype: City
        """
        return util.deserialize_model(dikt, cls)
    def from_dict(cls, dikt) -> 'ForecastInfo':
        """Returns the dict as a model

        :param dikt: A dict.
        :type: dict
        :return: The ForecastInfo of this ForecastInfo.  # noqa: E501
        :rtype: ForecastInfo
        """
        return util.deserialize_model(dikt, cls)
    def from_dict(cls, dikt) -> 'ApiResponse':
        """Returns the dict as a model

        :param dikt: A dict.
        :type: dict
        :return: The ApiResponse of this ApiResponse.  # noqa: E501
        :rtype: ApiResponse
        """
        return util.deserialize_model(dikt, cls)
 def get_all_city_objects(self):
     """
     Returns all City objects that are currently in the store
     """
     all_cities_objects = []
     all_cities = self.city_collection.find()
     for city in all_cities:
         city_obj = util.deserialize_model(city, City)
         all_cities_objects.append(city_obj)
     return all_cities_objects
Beispiel #6
0
 def from_dict(cls: typing.Type[T], dikt) -> T:
     """Returns the dict as a model"""
     return util.deserialize_model(dikt, cls)