From 2ece0eaeaf4a19f334ef96cb888e20eca990e8e5 Mon Sep 17 00:00:00 2001 From: Nico Vermaas <vermaas@astron.nl> Date: Tue, 22 Dec 2020 11:34:13 +0100 Subject: [PATCH] preparing to add JSONfields --- README.md | 3 --- .../0004_remove_observation_metadata.py | 17 +++++++++++++++++ atdb/taskdatabase/models.py | 4 ---- atdb/taskdatabase/serializers.py | 2 +- .../templates/taskdatabase/index.html | 2 +- atdb/taskdatabase/views.py | 2 +- 6 files changed, 20 insertions(+), 10 deletions(-) create mode 100644 atdb/taskdatabase/migrations/0004_remove_observation_metadata.py diff --git a/README.md b/README.md index 3df88590..68ecae32 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,6 @@ This diagram roughly serves as the specs for adapting ATDB for LDV. These diagrams are the core of the ATDB documentation. Currently they are still mostly the original ATDB diagrams. They will be adapted and kept in sync once the ATDB-LDV structure solifies a bit more. -Context Diagram: - * https://drive.google.com/file/d/1ltmzFMgOI24kIgPtaKrYl-j__ATOI3m6/view?usp=sharing - Datamodel: * https://drive.google.com/file/d/1v5hMBQS0jT8DQJwySVISfRa1zF4o0fCQ/view?usp=sharing diff --git a/atdb/taskdatabase/migrations/0004_remove_observation_metadata.py b/atdb/taskdatabase/migrations/0004_remove_observation_metadata.py new file mode 100644 index 00000000..4e21bb97 --- /dev/null +++ b/atdb/taskdatabase/migrations/0004_remove_observation_metadata.py @@ -0,0 +1,17 @@ +# Generated by Django 3.1.4 on 2020-12-22 10:31 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('taskdatabase', '0003_auto_20201218_1500'), + ] + + operations = [ + migrations.RemoveField( + model_name='observation', + name='metadata', + ), + ] diff --git a/atdb/taskdatabase/models.py b/atdb/taskdatabase/models.py index b4eb4142..8fb0c22d 100644 --- a/atdb/taskdatabase/models.py +++ b/atdb/taskdatabase/models.py @@ -42,7 +42,6 @@ class TaskObject(models.Model): # and I need services to be able to filter on a status to execute their tasks. my_status = models.CharField(db_index=True, max_length=50,default="defined") node = models.CharField(max_length=10, null=True, blank=True) - quality = models.CharField(max_length=30, default="unknown") def __str__(self): @@ -80,11 +79,8 @@ class Observation(TaskObject): field_name = models.CharField(max_length=50, null=True) field_ra = models.FloatField('field_ra', null = True) field_dec = models.FloatField('field_dec', null = True) - - metadata = models.CharField(max_length=255, default="unknown", null=True) skip_auto_ingest = models.BooleanField(default=False) - progress = models.CharField(max_length=40, default="", null=True) # this translates a view-name (from urls.py) back to a url, to avoid hardcoded url's in the html templates diff --git a/atdb/taskdatabase/serializers.py b/atdb/taskdatabase/serializers.py index b164a371..f6b5a71a 100644 --- a/atdb/taskdatabase/serializers.py +++ b/atdb/taskdatabase/serializers.py @@ -55,7 +55,7 @@ class ObservationSerializer(serializers.ModelSerializer): 'creationTime','starttime','endtime', 'duration', 'size', 'my_status','new_status','status_history', 'generated_dataproducts', - 'data_location', 'node','metadata', + 'data_location', 'node', 'skip_auto_ingest','observing_mode', 'quality','progress') diff --git a/atdb/taskdatabase/templates/taskdatabase/index.html b/atdb/taskdatabase/templates/taskdatabase/index.html index c56cc956..acaf7e10 100644 --- a/atdb/taskdatabase/templates/taskdatabase/index.html +++ b/atdb/taskdatabase/templates/taskdatabase/index.html @@ -46,7 +46,7 @@ </div> {% include 'taskdatabase/pagination.html' %} </div> - <p class="footer"> Version 1.0.0 (22 dec 2020 - 11:00) + <p class="footer"> Version 1.0.0 (22 dec 2020 - 11:30) <script type="text/javascript"> (function(seconds) { var refresh, diff --git a/atdb/taskdatabase/views.py b/atdb/taskdatabase/views.py index b9d809e6..8c44ff23 100644 --- a/atdb/taskdatabase/views.py +++ b/atdb/taskdatabase/views.py @@ -43,7 +43,7 @@ class ObservationFilter(filters.FilterSet): 'endtime': ['gt', 'lt', 'gte', 'lte', 'contains', 'exact'], 'data_location': ['exact', 'icontains'], 'node': ['exact', 'in'], - 'metadata': ['icontains'], + # 'metadata': ['icontains'], 'skip_auto_ingest': ['exact'], 'quality': ['exact', 'icontains'], } -- GitLab