예제 #1
0
def parse_raster_layer_if_status_is_unparsed(sender, instance, created,
                                             **kwargs):
    from raster.tasks import parse
    RasterLayerMetadata.objects.get_or_create(rasterlayer=instance)
    status, created = RasterLayerParseStatus.objects.get_or_create(
        rasterlayer=instance)
    if (instance.rasterfile.name
            or instance.source_url) and status.status == status.UNPARSED:
        parse(instance.id)
예제 #2
0
def parse_raster_layer_if_status_is_unparsed(sender, instance, created, **kwargs):
    from raster.tasks import parse
    RasterLayerMetadata.objects.get_or_create(rasterlayer=instance)
    status, created = RasterLayerParseStatus.objects.get_or_create(rasterlayer=instance)
    if (instance.rasterfile.name or instance.source_url) and status.status == status.UNPARSED:
        parse(instance.id)
예제 #3
0
 def test_no_raterfile(self):
     layer = RasterLayer.objects.create(name='No max zoom',
                                        build_pyramid=False)
     msg = 'No data source found. Provide a rasterfile or a source url.'
     with self.assertRaisesMessage(RasterException, msg):
         parse(layer)
 def test_no_raterfile(self):
     layer = RasterLayer.objects.create(name='No max zoom', build_pyramid=False)
     msg = 'No data source found. Provide a rasterfile or a source url.'
     with self.assertRaisesMessage(RasterException, msg):
         parse(layer)