vnoelifant / charity-finder

3 stars 0 forks source link

added changes from PR #31 related to heatmap #32

Closed vnoelifant closed 1 year ago

vnoelifant commented 1 year ago

In line 135 of import_organizations.py I kept the image link default since the "imagelink" key below is a list of dicts (indicating images of different size). Hope that's fine. Later on in the code I do a list comp to get the url string value.

        # parse images dictionary for image link
        images = project_row.get("image", {}).get("imagelink", [])
        if images is not None:
            if isinstance(images, dict):
                images = [images]

            image = [
                row.get("url") for row in images if row.get("@size") == "large"
            ][0]

            project.image = image

Screenshot (393)