From 36a0317f6734538d7b4d7fb72a1b1366a3916206 Mon Sep 17 00:00:00 2001 From: aanersc Date: Fri, 25 Sep 2020 15:03:45 +0200 Subject: [PATCH] #51 modifying the manager of nansat ingester --- geospaas/nansat_ingestor/managers.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/geospaas/nansat_ingestor/managers.py b/geospaas/nansat_ingestor/managers.py index c03efb5c..c7d00cc7 100644 --- a/geospaas/nansat_ingestor/managers.py +++ b/geospaas/nansat_ingestor/managers.py @@ -7,7 +7,7 @@ from django.db import models from geospaas.catalog.managers import FILE_SERVICE_NAME, LOCAL_FILE_SERVICE -from geospaas.catalog.models import (Dataset, DatasetParameter, DatasetURI, +from geospaas.catalog.models import (Dataset, DatasetURI, GeographicLocation, Source) from geospaas.utils.utils import nansat_filename, validate_uri from geospaas.vocabularies.models import (DataCenter, Instrument, @@ -132,7 +132,7 @@ def get_or_create(self, geometry=WKTReader().read(n.get_border_wkt(nPoints=n_points)))[0] # create dataset - # - the get_or_create method should use get_or_create here as well, + # - the get_or_create method should use get_or_create here as well, # or its name should be changed - see issue #127 ds, created = Dataset.objects.update_or_create(entry_id=options['entry_id'], defaults={ 'time_coverage_start': n.get_metadata('time_coverage_start'), @@ -161,8 +161,6 @@ def get_or_create(self, if params.count() > 1 and units is not None: params = params.filter(units=units) if params.count() >= 1: - DatasetParameter.objects.get_or_create( - dataset=ds, parameter=params[0]) ds.parameters.add(params[0]) # create dataset URI