Skip to content
Snippets Groups Projects
Commit 50cf5da4 authored by Nico Vermaas's avatar Nico Vermaas
Browse files

add activity model

parent 3a9be584
No related branches found
No related tags found
1 merge request!339SDC-1188 - STEP 1 of 3 (the database)
Pipeline #70727 failed
......@@ -3,8 +3,9 @@
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/venv" />
<excludeFolder url="file://$MODULE_DIR$/venv310" />
</content>
<orderEntry type="jdk" jdkName="Python 3.9 (atdb-ldv)" jdkType="Python SDK" />
<orderEntry type="jdk" jdkName="Python 3.10 (atdb-ldv)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="PyDocumentationSettings">
......
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9 (atdb-ldv)" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10 (atdb-ldv)" project-jdk-type="Python SDK" />
<component name="PyCharmProfessionalAdvertiser">
<option name="shown" value="true" />
</component>
......
......@@ -13,7 +13,7 @@ DATABASES = {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'USER': 'atdb_admin',
'PASSWORD': 'atdb123',
'NAME': 'atdb_ldv_12jan2024',
'NAME': 'atdb_ldv_19jan2024',
'HOST': 'localhost',
'PORT': '5432',
},
......
......@@ -95,6 +95,34 @@ def convert_summary_to_list_for_template(task):
class Activity(models.Model):
"""
update when tasks status changes from ??? to ???:
- to '???' : check for incoming 'archive' json from archiver
- to 'stored' : calculate qualities
- to ??? : calculate finished_fraction
- to ??? : calculate ingested_fraction
"""
# fields used in overview pages
sas_id = models.CharField(db_index=True, verbose_name="SAS_ID", max_length=15, blank=True, null=True)
workflow = models.ForeignKey(Workflow, related_name='tasks', on_delete=models.CASCADE, null=True, blank=True)
project = models.CharField(max_length=100, blank=True, null=True, default="unknown")
filter = models.CharField(max_length=30, blank=True, null=True)
status = models.CharField(db_index=True, default="unknown", max_length=50, blank=True, null=True)
calculated_qualities = models.JSONField(null=True, blank=True)
archive = models.JSONField(null=True, blank=True)
# output sas_id at LTA
output_sas_id = models.CharField(max_length=15, blank=True, null=True)
has_summary = models.BooleanField(default=False)
is_verified = models.BooleanField(default=False)
finished_fraction = models.FloatField(blank=True, null=True)
ingested_fraction = models.FloatField(blank=True, null=True)
class Task(models.Model):
# Task control properties
......
......@@ -31,7 +31,7 @@
{% include 'taskdatabase/pagination.html' %}
</div>
</div>
<p class="footer"> Version 18 Jan 2024
<p class="footer"> Version 2 Feb 2024
</div>
{% include 'taskdatabase/refresh.html' %}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment