You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think a fix would be to update the function as so
defsearch(self, query, category=None, orientation=None, page=1, per_page=10):
""" Get a single page from a photo search. Optionally limit your search to a set of categories by supplying the category ID’s. Note: If supplying multiple category ID’s, the resulting photos will be those that match all of the given categories, not ones that match any category. :param query [string]: Search terms. :param category [string]: Category ID(‘s) to filter search. If multiple, comma-separated. (deprecated) :param orientation [string]: Filter search results by photo orientation. Valid values are landscape, portrait, and squarish. :param page [integer]: Page number to retrieve. (Optional; default: 1) :param per_page [integer]: Number of items per page. (Optional; default: 10) :return: [Array]: A single page of the curated Photo list. :raise UnsplashError: If the given orientation is not in the default orientation values. """iforientationandorientationnotinself.orientation_values:
raiseException()
params= {
"query": query,
"category": category,
"orientation": orientation,
"page": page,
"per_page": per_page
}
url="/search/photos"# update the URL_result=self._get(url, params=params)
result=_result.get("results", []) # returns a dict, so key into what the function would have been expectingreturnPhotoModel.parse_list(result)
The text was updated successfully, but these errors were encountered:
I'm trying to use this in a webapp I'm building, but I keep getting this "Cannot find Asset" error when searching for photos.
I think this url is backwards per unsplash API docs
python-unsplash/unsplash/photo.py
Line 107 in f15d1c8
I think a fix would be to update the function as so
The text was updated successfully, but these errors were encountered: