Closed vnoelifant closed 1 year ago
@vnoelifant seems you're access country_code
on Theme
, but it's an attribute of Country
. This happens in the command script:
else Theme.objects.get_or_create(
name=row.get("name", ""), country_code=row.get("iso3166CountryCode", "")
)
Closing this with following notes: Latest commit: https://github.com/vnoelifant/charity-finder/pull/21/commits/73994d91cc43a340da8512d4c60d3b5e58af3e00
1) Burma Humanitarian Mission shows themes and countries data but the original JSON orgs file (that I sent you in Slack) shows that these fields should be Null. What could be the cause of this? I realize that I use the continue
statement in import_organizations.py if themes and countries is None
so I thought maybe it relates to that, and writing data that is not needed, and skipping over writing data that is needed. Would I need to use a generator maybe?
2) There is duplicate code in lines 47-90 in import_organizations.py . Any suggestions to wrap this all into a function?
Closing this with following notes: Latest commit: 73994d9
- Burma Humanitarian Mission shows themes and countries data but the original JSON orgs file (that I sent you in Slack) shows that these fields should be Null. What could be the cause of this? I realize that I use the
continue
statement in import_organizations.py if themes and countries isNone
so I thought maybe it relates to that, and writing data that is not needed, and skipping over writing data that is needed. Would I need to use a generator maybe?- There is duplicate code in lines 47-90 in import_organizations.py . Any suggestions to wrap this all into a function?
Happy to look at this today on our call ...
Didn't really have time to debug this, but I am getting this error after trying to seed the countries dictionary from the organization data:
Also for some reason in my admin I still see the plural display of Country model as "Countrys" even if I added the following in models.py:
Please let me know your comments/refactoring suggestions. Thank you!