Skip to content
Snippets Groups Projects

Add form, url, template and view; no functionality yet

Merged Fanna Lautenbach requested to merge SDC-810/group-creation into main
2 unresolved threads
1 file
+ 1
1
Compare changes
  • Side-by-side
  • Inline
+ 26
4
from django.core.exceptions import ValidationError
from .models import WorkSpecification, DataProductFilter
from .models import WorkSpecification, DataProductFilter, Group
from django.forms import ModelForm
from django.forms import ModelForm, CharField
class WorkSpecificationForm(ModelForm):
@@ -30,14 +30,14 @@ class WorkSpecificationForm(ModelForm):
class Meta:
model = WorkSpecification
fields = ['filters', 'selected_workflow', 'selected_workflow_tag', 'processing_site',
'predecessor_specification', 'batch_size',
'is_auto_submit']
'predecessor_specification', 'batch_size', 'group', 'is_auto_submit']
labels = {
'selected_workflow': 'Selected workflow',
'selected_workflow_tag': 'Workflow tag',
'processing_site': 'Processing Site (ATDB)',
'predecessor_specification': 'Predecessor',
'batch_size': 'Files per task',
'group': 'Group',
'is_auto_submit': 'Auto submit'
}
help_texts = {'selected_workflow': "The pipeline to run on the processing site.",
@@ -45,5 +45,27 @@ class WorkSpecificationForm(ModelForm):
'processing_site': "The ATDB processing site to run a specific workflow in.",
'predecessor_specification': "The related predecessor of the current work specification.",
'batch_size': "The number of files every task generated by this work specification should have. Example: 10 files in total can be split into 5 tasks of 2 files.",
'group': "Include the work specification to a group. Note that it will inherit the group's processing site and workflow specifications.",
'is_auto_submit': "By checking this box, the work specification will be directly sent to the processing site and thus does not need inspection."
}
class GroupForm(ModelForm):
obs_ids = CharField(label='SAS IDs',
Please register or sign in to reply
help_text="A list of SAS IDs separated with a comma. Example: 123, 456, 789",
required=True)
class Meta:
model = Group
fields = ['name', 'selected_workflow', 'selected_workflow_tag', 'processing_site', 'obs_ids']
labels = {
'selected_workflow': 'Selected workflow',
'selected_workflow_tag': 'Workflow tag',
'processing_site': 'Processing Site (ATDB)',
'name': 'Name',
}
help_texts = {'selected_workflow': "The pipeline to run on the processing site.",
'selected_workflow_tag': "The pipeline's tag as specified in ATDB.",
'processing_site': "The ATDB processing site to run a specific workflow in.",
'name': "A unique and custom name for this group"
}
Loading