From 8e60bd72004965d4723707ec827fd83b2fbddd0b Mon Sep 17 00:00:00 2001 From: aanersc Date: Fri, 25 Sep 2020 15:01:34 +0200 Subject: [PATCH] #51 modifying models.py --- geospaas/catalog/models.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/geospaas/catalog/models.py b/geospaas/catalog/models.py index 87e645fc..889fef3c 100644 --- a/geospaas/catalog/models.py +++ b/geospaas/catalog/models.py @@ -109,7 +109,7 @@ class Dataset(models.Model): entry_id : CharField A unique dataset ID. Only alpanumeric characters are allowed. entry_title : CharField - parameters: ManyToManyField to Parameter through DatasetParameter + parameters: ManyToManyField to Parameter ISO_topic_category : ForeignKey to ISOTopicCategory data_center : ForeignKey to DataCenter summary : TextField @@ -144,7 +144,7 @@ class Dataset(models.Model): ] ) entry_title = models.CharField(max_length=220) - parameters = models.ManyToManyField(Parameter, through='DatasetParameter') + parameters = models.ManyToManyField(Parameter) ISO_topic_category = models.ForeignKey(ISOTopicCategory, on_delete=models.CASCADE) data_center = models.ForeignKey(DataCenter, on_delete=models.CASCADE) summary = models.TextField() @@ -174,12 +174,6 @@ def __str__(self): # temporal_resolution = models.CharField(max_length=220) # temporal_resolution_range = models.ForeignKey(TemporalDataResolution) -class DatasetParameter(models.Model): - dataset = models.ForeignKey(Dataset, on_delete=models.CASCADE) - parameter = models.ForeignKey(Parameter, on_delete=models.CASCADE) - - def __str__(self): - return '%s:%s' %(self.dataset, self.parameter) class DatasetURI(models.Model):