def exportShapefile(request, shapefile_id): """ Let the user export the given shapefile. """ shapefile = Shapefile.objects.get(id=shapefile_id) if shapefile != None: return shapefileIO.exportData(shapefile) else: return HttpResponseRedirect("/shape-editor")
def exportShapefile(request, shapefile_id): try: shapefile = Shapefile.objects.get(id=shapefile_id) except Shapefile.DoesNotExist: raise Http404 return shapefileIO.exportData(shapefile)