Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add geolocation #764

Merged
merged 13 commits into from
Sep 23, 2022
Prev Previous commit
Next Next commit
apply black
  • Loading branch information
top-on committed Sep 23, 2022
commit 3e336341b9b40222f9e23274adb64813ebeaff58
4 changes: 3 additions & 1 deletion backend/scraping/spiders/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ def process_item(self, item, spider): # skipcq: PYL-W0613


from geopy.geocoders import Nominatim


class DatabaseExportPipeline:
def process_item(self, item, spider):
with transaction.atomic():
Expand All @@ -76,7 +78,7 @@ def process_item(self, item, spider):
values["location"], _ = Location.objects.get_or_create(
description=item["location"],
lat=location.latitude,
lon=location.longitude
lon=location.longitude,
)
if item["organizer"]:
values["organizer"], _ = Organizer.objects.get_or_create(
Expand Down