Skip to content

Commit

Permalink
fix multiple states for same point bug; set file extension for sheets…
Browse files Browse the repository at this point in the history
… export; add xmlx missing dependencie
  • Loading branch information
brunosmartin committed Apr 27, 2018
1 parent 73410fa commit e0fc0bd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions mapaguarani/core/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@ def state(self):
return State.objects.get(geometry__covers=self.geometry)
except State.DoesNotExist:
return
except State.MultipleObjectsReturned:
return State.objects.filter(geometry__covers=self.geometry).first()

@property
def country(self):
Expand Down
6 changes: 3 additions & 3 deletions mapaguarani/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@

url(r'^api/pages', include('pages.urls', namespace='pages')),

url(r'^export/villages$', IndigenousVillageExportView.as_view(), name='export_xls_villages'),
url(r'^export/villages.xlsx$', IndigenousVillageExportView.as_view(), name='export_xls_villages'),

url(r'^export/lands$', IndigenousLandExportView.as_view(), name='export_xls_lands'),
url(r'^export/lands.xlsx$', IndigenousLandExportView.as_view(), name='export_xls_lands'),

url(r'^export/archaeological$', ArchaeologicalPlaceExportView.as_view(), name='export_xls_archaeological'),
url(r'^export/archaeological.xlsx$', ArchaeologicalPlaceExportView.as_view(), name='export_xls_archaeological'),

url(r'^shapefiles/villages/$', IndigenousVillagesShapefileView.as_view(), name='villages_shapefiles'),

Expand Down
1 change: 1 addition & 0 deletions requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ python-memcached

rest-pandas==0.5.0
xlwt==1.1.2
openpyxl==2.5.3

django-compressor==2.1
libsass==0.9.3
Expand Down

0 comments on commit e0fc0bd

Please sign in to comment.