django-to-galaxy 0.7.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- django_to_galaxy/__init__.py +1 -0
- django_to_galaxy/admin/__init__.py +13 -0
- django_to_galaxy/admin/galaxy_element.py +6 -0
- django_to_galaxy/admin/galaxy_instance.py +26 -0
- django_to_galaxy/admin/galaxy_output_file.py +79 -0
- django_to_galaxy/admin/galaxy_user.py +183 -0
- django_to_galaxy/admin/history.py +91 -0
- django_to_galaxy/admin/invocation.py +154 -0
- django_to_galaxy/admin/tag.py +17 -0
- django_to_galaxy/admin/utils.py +116 -0
- django_to_galaxy/admin/workflow.py +131 -0
- django_to_galaxy/api/__init__.py +0 -0
- django_to_galaxy/api/serializers/asymetricslugrelatedfield.py +31 -0
- django_to_galaxy/api/serializers/create_dataset_collection.py +118 -0
- django_to_galaxy/api/serializers/create_history.py +6 -0
- django_to_galaxy/api/serializers/galaxy_instance.py +10 -0
- django_to_galaxy/api/serializers/galaxy_output_file.py +17 -0
- django_to_galaxy/api/serializers/galaxy_user.py +20 -0
- django_to_galaxy/api/serializers/history.py +17 -0
- django_to_galaxy/api/serializers/invocation.py +22 -0
- django_to_galaxy/api/serializers/invoke_workflow.py +24 -0
- django_to_galaxy/api/serializers/upload_to_history.py +25 -0
- django_to_galaxy/api/serializers/workflow.py +41 -0
- django_to_galaxy/api/urls.py +53 -0
- django_to_galaxy/api/views/create_dataset_collection.py +461 -0
- django_to_galaxy/api/views/create_history.py +23 -0
- django_to_galaxy/api/views/galaxy_instance.py +13 -0
- django_to_galaxy/api/views/galaxy_output_file.py +15 -0
- django_to_galaxy/api/views/galaxy_user.py +13 -0
- django_to_galaxy/api/views/history.py +14 -0
- django_to_galaxy/api/views/invocation.py +45 -0
- django_to_galaxy/api/views/invoke_workflow.py +181 -0
- django_to_galaxy/api/views/upload_to_history.py +78 -0
- django_to_galaxy/api/views/workflow.py +14 -0
- django_to_galaxy/apps.py +6 -0
- django_to_galaxy/migrations/0001_new_initial.py +171 -0
- django_to_galaxy/migrations/0002_rename_state_history_galaxy_state_and_more.py +37 -0
- django_to_galaxy/migrations/0003_invocation_create_time.py +20 -0
- django_to_galaxy/migrations/0004_alter_galaxyuser_email_galaxyoutputfile.py +46 -0
- django_to_galaxy/migrations/0005_alter_galaxyoutputfile_invocation_and_more.py +37 -0
- django_to_galaxy/migrations/0006_tag_history_tags_workflow_tags.py +42 -0
- django_to_galaxy/migrations/0007_format_alter_history_tags_alter_workflow_tags_and_more.py +63 -0
- django_to_galaxy/migrations/0008_workflowinput_label.py +21 -0
- django_to_galaxy/migrations/0009_galaxyoutputfile_unique_galaxy_id_per_invocation.py +20 -0
- django_to_galaxy/migrations/0010_workflow__is_meta_workflow__step_jobs_count.py +23 -0
- django_to_galaxy/migrations/0011_rename__step_jobs_count_workflow__step_count_and_more.py +23 -0
- django_to_galaxy/migrations/0012_workflowinput_collection_type_and_more.py +136 -0
- django_to_galaxy/migrations/__init__.py +0 -0
- django_to_galaxy/models/__init__.py +8 -0
- django_to_galaxy/models/accepted_input.py +139 -0
- django_to_galaxy/models/galaxy_element.py +52 -0
- django_to_galaxy/models/galaxy_instance.py +29 -0
- django_to_galaxy/models/galaxy_output_file.py +53 -0
- django_to_galaxy/models/galaxy_user.py +94 -0
- django_to_galaxy/models/history.py +73 -0
- django_to_galaxy/models/invocation.py +251 -0
- django_to_galaxy/models/workflow.py +440 -0
- django_to_galaxy/schemas/__init__.py +0 -0
- django_to_galaxy/schemas/dataset.py +16 -0
- django_to_galaxy/settings.py +8 -0
- django_to_galaxy/templates/admin/import_workflows.html +89 -0
- django_to_galaxy/urls.py +3 -0
- django_to_galaxy/utils.py +61 -0
- django_to_galaxy/version.py +3 -0
- django_to_galaxy-0.7.0.0.dist-info/METADATA +17 -0
- django_to_galaxy-0.7.0.0.dist-info/RECORD +68 -0
- django_to_galaxy-0.7.0.0.dist-info/WHEEL +4 -0
- django_to_galaxy-0.7.0.0.dist-info/licenses/LICENSE +661 -0
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import django.apps
|
|
2
|
+
from django.db.models.fields.files import FieldFile
|
|
3
|
+
from django.core.exceptions import ObjectDoesNotExist
|
|
4
|
+
from drf_yasg.utils import swagger_auto_schema
|
|
5
|
+
from rest_framework.response import Response
|
|
6
|
+
|
|
7
|
+
from rest_framework.generics import GenericAPIView, RetrieveAPIView
|
|
8
|
+
from rest_framework.status import HTTP_404_NOT_FOUND
|
|
9
|
+
|
|
10
|
+
from django_to_galaxy.models import History, Workflow, GalaxyUser
|
|
11
|
+
from django_to_galaxy.api.serializers.invoke_workflow import (
|
|
12
|
+
InvokeWorkflowSerializer,
|
|
13
|
+
ExecuteWorkflowSerializer,
|
|
14
|
+
GenericDictSerializer,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class InvokeWorkflowView(GenericAPIView):
|
|
19
|
+
serializer_class = InvokeWorkflowSerializer
|
|
20
|
+
|
|
21
|
+
@swagger_auto_schema(
|
|
22
|
+
operation_description="Invoke workflow using data from a history.",
|
|
23
|
+
operation_summary="Invoke workflow using data from a history.",
|
|
24
|
+
tags=["workflows"],
|
|
25
|
+
)
|
|
26
|
+
def post(self, request):
|
|
27
|
+
serializer_class = self.get_serializer_class()
|
|
28
|
+
serializer = serializer_class(data=request.data, context={"request": request})
|
|
29
|
+
serializer.is_valid(raise_exception=True)
|
|
30
|
+
data = serializer.data
|
|
31
|
+
# Retrieve history
|
|
32
|
+
try:
|
|
33
|
+
history = History.objects.get(id=data["history_id"])
|
|
34
|
+
except ObjectDoesNotExist:
|
|
35
|
+
return Response(
|
|
36
|
+
{
|
|
37
|
+
"message": (
|
|
38
|
+
"Galaxy history with id ",
|
|
39
|
+
f"<{data['history_id']}> not found!",
|
|
40
|
+
)
|
|
41
|
+
},
|
|
42
|
+
status=HTTP_404_NOT_FOUND,
|
|
43
|
+
)
|
|
44
|
+
# Retrieve workflow
|
|
45
|
+
try:
|
|
46
|
+
workflow = Workflow.objects.get(id=data["workflow_id"])
|
|
47
|
+
except ObjectDoesNotExist:
|
|
48
|
+
return Response(
|
|
49
|
+
{
|
|
50
|
+
"message": (
|
|
51
|
+
"Galaxy workflow with id ",
|
|
52
|
+
f"<{data['history_id']}> not found!",
|
|
53
|
+
)
|
|
54
|
+
},
|
|
55
|
+
status=HTTP_404_NOT_FOUND,
|
|
56
|
+
)
|
|
57
|
+
inv = workflow.invoke(data["datamap"], history=history)
|
|
58
|
+
data["message"] = "Workflow successfully invoked."
|
|
59
|
+
data["invocation_id"] = inv.id
|
|
60
|
+
return Response(data=data)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
class GetWorkflowDatamapTemplateView(RetrieveAPIView):
|
|
64
|
+
queryset = Workflow.objects.all()
|
|
65
|
+
serializer_class = GenericDictSerializer
|
|
66
|
+
|
|
67
|
+
@swagger_auto_schema(
|
|
68
|
+
operation_description="Get workflow datamap to prepare workflow invocation.",
|
|
69
|
+
operation_summary="Get workflow datamap to prepare workflow invocation.",
|
|
70
|
+
tags=["workflows"],
|
|
71
|
+
responses={200: GenericDictSerializer},
|
|
72
|
+
)
|
|
73
|
+
def get(self, request, *args, **kwargs):
|
|
74
|
+
instance = self.get_object()
|
|
75
|
+
datamap = instance.get_workflow_datamap_template()
|
|
76
|
+
|
|
77
|
+
return Response(data=datamap)
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
"""
|
|
81
|
+
class GetWorkflowInputsView(RetrieveAPIView):
|
|
82
|
+
queryset = Workflow.objects.all()
|
|
83
|
+
|
|
84
|
+
@swagger_auto_schema(
|
|
85
|
+
operation_description="Get workflow inputs information from Galaxy.",
|
|
86
|
+
operation_summary="Get workflow inputs information from Galaxy.",
|
|
87
|
+
tags=["workflows"],
|
|
88
|
+
)
|
|
89
|
+
def get(self, request, *args, **kwargs):
|
|
90
|
+
instance = self.get_object()
|
|
91
|
+
data = instance.get_workflow_inputs()
|
|
92
|
+
|
|
93
|
+
return Response(data=data)
|
|
94
|
+
"""
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
class ExecuteWorkflowView(GenericAPIView):
|
|
98
|
+
serializer_class = ExecuteWorkflowSerializer
|
|
99
|
+
|
|
100
|
+
@swagger_auto_schema(
|
|
101
|
+
operation_description="Execute workflow using data from a model and a Galaxy user.",
|
|
102
|
+
operation_summary="Execute workflow using data from a model and a Galaxy user.",
|
|
103
|
+
tags=["workflows"],
|
|
104
|
+
)
|
|
105
|
+
def post(self, request):
|
|
106
|
+
# Get data from POST request
|
|
107
|
+
serializer_class = self.get_serializer_class()
|
|
108
|
+
serializer = serializer_class(data=request.data, context={"request": request})
|
|
109
|
+
serializer.is_valid(raise_exception=True)
|
|
110
|
+
data = serializer.data
|
|
111
|
+
# Create History -> @TODO to refactor in function
|
|
112
|
+
# - First retrieve galaxy user
|
|
113
|
+
galaxy_user_id = data["galaxy_user_id"]
|
|
114
|
+
try:
|
|
115
|
+
galaxy_user = GalaxyUser.objects.get(id=galaxy_user_id)
|
|
116
|
+
except ObjectDoesNotExist:
|
|
117
|
+
return Response(
|
|
118
|
+
{
|
|
119
|
+
"message": (
|
|
120
|
+
"Galaxy User with id ",
|
|
121
|
+
f"<{galaxy_user_id}> not found!",
|
|
122
|
+
)
|
|
123
|
+
},
|
|
124
|
+
status=HTTP_404_NOT_FOUND,
|
|
125
|
+
)
|
|
126
|
+
history = galaxy_user.create_history()
|
|
127
|
+
# Upload data to history -> @TODO to refactor in function
|
|
128
|
+
# - Retrieve all models
|
|
129
|
+
all_models = django.apps.apps.get_models()
|
|
130
|
+
all_models_dict = {m.__name__.lower(): m for m in all_models}
|
|
131
|
+
fake_datamap = data["fake_datamap"]
|
|
132
|
+
# - Upload each data to history
|
|
133
|
+
datamap = {}
|
|
134
|
+
for input_id, input_object in fake_datamap.items():
|
|
135
|
+
try:
|
|
136
|
+
file = all_models_dict[input_object["model"]].objects.get(
|
|
137
|
+
id=input_object["id"]
|
|
138
|
+
)
|
|
139
|
+
except ObjectDoesNotExist:
|
|
140
|
+
return Response(
|
|
141
|
+
{"message": f"File with id <{input_object['id']}> not found!"},
|
|
142
|
+
status=HTTP_404_NOT_FOUND,
|
|
143
|
+
)
|
|
144
|
+
try:
|
|
145
|
+
file_path = getattr(file, input_object["path_field"])
|
|
146
|
+
except AttributeError:
|
|
147
|
+
return Response(
|
|
148
|
+
{"message": f"File with id <{input_object['id']}> not found!"},
|
|
149
|
+
status=HTTP_404_NOT_FOUND,
|
|
150
|
+
)
|
|
151
|
+
if isinstance(file_path, FieldFile):
|
|
152
|
+
file_path = file_path.path
|
|
153
|
+
try:
|
|
154
|
+
file_type = input_object["file_type"]
|
|
155
|
+
except AttributeError:
|
|
156
|
+
return Response(
|
|
157
|
+
{"message": f"File with id <{input_object['id']}> not found!"},
|
|
158
|
+
status=HTTP_404_NOT_FOUND,
|
|
159
|
+
)
|
|
160
|
+
history_association = history.upload_file(file_path, file_type=file_type)
|
|
161
|
+
datamap[input_id] = {"id": history_association.id, "src": "hda"}
|
|
162
|
+
# Invoke workflow -> @TODO to refactor in function
|
|
163
|
+
# - Retrieve workflow
|
|
164
|
+
try:
|
|
165
|
+
workflow = Workflow.objects.get(id=data["workflow_id"])
|
|
166
|
+
except ObjectDoesNotExist:
|
|
167
|
+
return Response(
|
|
168
|
+
{
|
|
169
|
+
"message": (
|
|
170
|
+
"Galaxy workflow with id ",
|
|
171
|
+
f"<{data['history_id']}> not found!",
|
|
172
|
+
)
|
|
173
|
+
},
|
|
174
|
+
status=HTTP_404_NOT_FOUND,
|
|
175
|
+
)
|
|
176
|
+
# - Invoke workflow
|
|
177
|
+
inv = workflow.invoke(datamap, history=history)
|
|
178
|
+
data["message"] = "Workflow successfully invoked."
|
|
179
|
+
data["invocation_id"] = inv.id
|
|
180
|
+
data["datamap"] = datamap
|
|
181
|
+
return Response(data=data)
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import django.apps
|
|
2
|
+
from django.core.exceptions import ObjectDoesNotExist
|
|
3
|
+
from drf_yasg.utils import swagger_auto_schema
|
|
4
|
+
from rest_framework.response import Response
|
|
5
|
+
from django.db.models.fields.files import FieldFile
|
|
6
|
+
|
|
7
|
+
from rest_framework.generics import GenericAPIView
|
|
8
|
+
from rest_framework.status import HTTP_404_NOT_FOUND
|
|
9
|
+
|
|
10
|
+
from django_to_galaxy.models import History
|
|
11
|
+
from django_to_galaxy.api.serializers.upload_to_history import UploadHistorySerializer
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class UploadToHistoryView(GenericAPIView):
|
|
15
|
+
serializer_class = UploadHistorySerializer
|
|
16
|
+
|
|
17
|
+
@swagger_auto_schema(
|
|
18
|
+
operation_description="Upload file from django file system to a Galaxy history.",
|
|
19
|
+
operation_summary="Upload file from a model with filepath to history.",
|
|
20
|
+
tags=["histories"],
|
|
21
|
+
)
|
|
22
|
+
def post(self, request):
|
|
23
|
+
serializer_class = self.get_serializer_class()
|
|
24
|
+
serializer = serializer_class(data=request.data, context={"request": request})
|
|
25
|
+
serializer.is_valid(raise_exception=True)
|
|
26
|
+
data = serializer.data
|
|
27
|
+
# Retrieve history
|
|
28
|
+
try:
|
|
29
|
+
history = History.objects.get(id=data["history_id"])
|
|
30
|
+
except ObjectDoesNotExist:
|
|
31
|
+
return Response(
|
|
32
|
+
{
|
|
33
|
+
"message": (
|
|
34
|
+
"Galaxy history with id ",
|
|
35
|
+
f"<{data['history_id']}> not found!",
|
|
36
|
+
)
|
|
37
|
+
},
|
|
38
|
+
status=HTTP_404_NOT_FOUND,
|
|
39
|
+
)
|
|
40
|
+
# Retrieve file & file path
|
|
41
|
+
all_models = django.apps.apps.get_models()
|
|
42
|
+
all_models_dict = {m.__name__.lower(): m for m in all_models}
|
|
43
|
+
try:
|
|
44
|
+
file = all_models_dict[data["file"]["model"]].objects.get(
|
|
45
|
+
id=data["file"]["id"]
|
|
46
|
+
)
|
|
47
|
+
except ObjectDoesNotExist:
|
|
48
|
+
return Response(
|
|
49
|
+
{"message": f"File with id <{data['file']['id']}> not found!"},
|
|
50
|
+
status=HTTP_404_NOT_FOUND,
|
|
51
|
+
)
|
|
52
|
+
try:
|
|
53
|
+
file_path = getattr(file, data["file"]["path_field"])
|
|
54
|
+
except AttributeError:
|
|
55
|
+
return Response(
|
|
56
|
+
{"message": f"File with id <{data['file']['id']}> not found!"},
|
|
57
|
+
status=HTTP_404_NOT_FOUND,
|
|
58
|
+
)
|
|
59
|
+
if isinstance(file_path, FieldFile):
|
|
60
|
+
file_path = file_path.path
|
|
61
|
+
try:
|
|
62
|
+
file_type = data["file"]["file_type"]
|
|
63
|
+
except AttributeError:
|
|
64
|
+
return Response(
|
|
65
|
+
{"message": f"File with id <{data['file']['id']}> not found!"},
|
|
66
|
+
status=HTTP_404_NOT_FOUND,
|
|
67
|
+
)
|
|
68
|
+
history_association = history.upload_file(file_path, file_type=file_type)
|
|
69
|
+
message = (
|
|
70
|
+
f"File <{str(file)}> has been uploaded to Galaxy History <{str(history)}>"
|
|
71
|
+
)
|
|
72
|
+
return Response(
|
|
73
|
+
{
|
|
74
|
+
"message": message,
|
|
75
|
+
"file_galaxy_id": history_association.id,
|
|
76
|
+
"history_id": history.id,
|
|
77
|
+
}
|
|
78
|
+
)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
from rest_framework import viewsets
|
|
2
|
+
|
|
3
|
+
from django_to_galaxy.models.workflow import Workflow
|
|
4
|
+
from django_to_galaxy.api.serializers.workflow import WorkflowSerializer
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class WorkflowViewSet(viewsets.ReadOnlyModelViewSet):
|
|
8
|
+
"""
|
|
9
|
+
API endpoint that allows workflows to be viewed.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
queryset = Workflow.objects.all()
|
|
13
|
+
lookup_field = "galaxy_id"
|
|
14
|
+
serializer_class = WorkflowSerializer
|
django_to_galaxy/apps.py
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# Generated by Django 4.0.3 on 2022-07-19 09:09
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
import django.db.models.deletion
|
|
5
|
+
import django.utils.timezone
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Migration(migrations.Migration):
|
|
9
|
+
|
|
10
|
+
replaces = [
|
|
11
|
+
("django_to_galaxy", "0001_initial"),
|
|
12
|
+
(
|
|
13
|
+
"django_to_galaxy",
|
|
14
|
+
"0002_alter_galaxyuser_galaxy_instance_alter_history_owner_and_more",
|
|
15
|
+
),
|
|
16
|
+
("django_to_galaxy", "0003_remove_history_latest_payload_and_more"),
|
|
17
|
+
("django_to_galaxy", "0004_alter_history_unique_together_and_more"),
|
|
18
|
+
("django_to_galaxy", "0005_alter_workflow_unique_together_invocation"),
|
|
19
|
+
("django_to_galaxy", "0006_rename_owner_history_galaxy_owner_and_more"),
|
|
20
|
+
("django_to_galaxy", "0007_history_create_time"),
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
initial = True
|
|
24
|
+
|
|
25
|
+
dependencies = []
|
|
26
|
+
|
|
27
|
+
operations = [
|
|
28
|
+
migrations.CreateModel(
|
|
29
|
+
name="GalaxyInstance",
|
|
30
|
+
fields=[
|
|
31
|
+
(
|
|
32
|
+
"id",
|
|
33
|
+
models.BigAutoField(
|
|
34
|
+
auto_created=True,
|
|
35
|
+
primary_key=True,
|
|
36
|
+
serialize=False,
|
|
37
|
+
verbose_name="ID",
|
|
38
|
+
),
|
|
39
|
+
),
|
|
40
|
+
("url", models.URLField(max_length=100)),
|
|
41
|
+
("name", models.CharField(max_length=100, unique=True)),
|
|
42
|
+
],
|
|
43
|
+
),
|
|
44
|
+
migrations.CreateModel(
|
|
45
|
+
name="GalaxyUser",
|
|
46
|
+
fields=[
|
|
47
|
+
(
|
|
48
|
+
"id",
|
|
49
|
+
models.BigAutoField(
|
|
50
|
+
auto_created=True,
|
|
51
|
+
primary_key=True,
|
|
52
|
+
serialize=False,
|
|
53
|
+
verbose_name="ID",
|
|
54
|
+
),
|
|
55
|
+
),
|
|
56
|
+
(
|
|
57
|
+
"email",
|
|
58
|
+
models.EmailField(
|
|
59
|
+
help_text="Email used for the Galaxy account", max_length=254
|
|
60
|
+
),
|
|
61
|
+
),
|
|
62
|
+
("api_key", models.CharField(max_length=50)),
|
|
63
|
+
(
|
|
64
|
+
"galaxy_instance",
|
|
65
|
+
models.ForeignKey(
|
|
66
|
+
on_delete=django.db.models.deletion.CASCADE,
|
|
67
|
+
related_name="users",
|
|
68
|
+
to="django_to_galaxy.galaxyinstance",
|
|
69
|
+
),
|
|
70
|
+
),
|
|
71
|
+
],
|
|
72
|
+
),
|
|
73
|
+
migrations.CreateModel(
|
|
74
|
+
name="History",
|
|
75
|
+
fields=[
|
|
76
|
+
(
|
|
77
|
+
"id",
|
|
78
|
+
models.BigAutoField(
|
|
79
|
+
auto_created=True,
|
|
80
|
+
primary_key=True,
|
|
81
|
+
serialize=False,
|
|
82
|
+
verbose_name="ID",
|
|
83
|
+
),
|
|
84
|
+
),
|
|
85
|
+
("galaxy_id", models.CharField(max_length=50)),
|
|
86
|
+
("name", models.CharField(max_length=200)),
|
|
87
|
+
("annotation", models.CharField(max_length=200)),
|
|
88
|
+
("published", models.BooleanField()),
|
|
89
|
+
("state", models.CharField(max_length=100)),
|
|
90
|
+
(
|
|
91
|
+
"galaxy_owner",
|
|
92
|
+
models.ForeignKey(
|
|
93
|
+
on_delete=django.db.models.deletion.CASCADE,
|
|
94
|
+
related_name="histories",
|
|
95
|
+
to="django_to_galaxy.galaxyuser",
|
|
96
|
+
),
|
|
97
|
+
),
|
|
98
|
+
(
|
|
99
|
+
"create_time",
|
|
100
|
+
models.DateTimeField(default=django.utils.timezone.now),
|
|
101
|
+
),
|
|
102
|
+
],
|
|
103
|
+
options={
|
|
104
|
+
"abstract": False,
|
|
105
|
+
"verbose_name_plural": "Histories",
|
|
106
|
+
"unique_together": {("galaxy_id", "galaxy_owner")},
|
|
107
|
+
},
|
|
108
|
+
),
|
|
109
|
+
migrations.CreateModel(
|
|
110
|
+
name="Workflow",
|
|
111
|
+
fields=[
|
|
112
|
+
(
|
|
113
|
+
"id",
|
|
114
|
+
models.BigAutoField(
|
|
115
|
+
auto_created=True,
|
|
116
|
+
primary_key=True,
|
|
117
|
+
serialize=False,
|
|
118
|
+
verbose_name="ID",
|
|
119
|
+
),
|
|
120
|
+
),
|
|
121
|
+
("galaxy_id", models.CharField(max_length=50)),
|
|
122
|
+
("name", models.CharField(max_length=200)),
|
|
123
|
+
("annotation", models.CharField(max_length=200)),
|
|
124
|
+
("published", models.BooleanField()),
|
|
125
|
+
(
|
|
126
|
+
"galaxy_owner",
|
|
127
|
+
models.ForeignKey(
|
|
128
|
+
on_delete=django.db.models.deletion.CASCADE,
|
|
129
|
+
related_name="workflows",
|
|
130
|
+
to="django_to_galaxy.galaxyuser",
|
|
131
|
+
),
|
|
132
|
+
),
|
|
133
|
+
],
|
|
134
|
+
options={
|
|
135
|
+
"abstract": False,
|
|
136
|
+
"unique_together": set(),
|
|
137
|
+
},
|
|
138
|
+
),
|
|
139
|
+
migrations.CreateModel(
|
|
140
|
+
name="Invocation",
|
|
141
|
+
fields=[
|
|
142
|
+
(
|
|
143
|
+
"id",
|
|
144
|
+
models.BigAutoField(
|
|
145
|
+
auto_created=True,
|
|
146
|
+
primary_key=True,
|
|
147
|
+
serialize=False,
|
|
148
|
+
verbose_name="ID",
|
|
149
|
+
),
|
|
150
|
+
),
|
|
151
|
+
("galaxy_id", models.CharField(max_length=50)),
|
|
152
|
+
("state", models.CharField(max_length=200)),
|
|
153
|
+
(
|
|
154
|
+
"history",
|
|
155
|
+
models.ForeignKey(
|
|
156
|
+
on_delete=django.db.models.deletion.CASCADE,
|
|
157
|
+
related_name="histories",
|
|
158
|
+
to="django_to_galaxy.history",
|
|
159
|
+
),
|
|
160
|
+
),
|
|
161
|
+
(
|
|
162
|
+
"workflow",
|
|
163
|
+
models.ForeignKey(
|
|
164
|
+
on_delete=django.db.models.deletion.CASCADE,
|
|
165
|
+
related_name="workflows",
|
|
166
|
+
to="django_to_galaxy.workflow",
|
|
167
|
+
),
|
|
168
|
+
),
|
|
169
|
+
],
|
|
170
|
+
),
|
|
171
|
+
]
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Generated by Django 4.0.3 on 2022-07-21 12:37
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
|
|
8
|
+
dependencies = [
|
|
9
|
+
("django_to_galaxy", "0001_new_initial"),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
operations = [
|
|
13
|
+
migrations.RenameField(
|
|
14
|
+
model_name="history",
|
|
15
|
+
old_name="state",
|
|
16
|
+
new_name="galaxy_state",
|
|
17
|
+
),
|
|
18
|
+
migrations.RenameField(
|
|
19
|
+
model_name="invocation",
|
|
20
|
+
old_name="state",
|
|
21
|
+
new_name="galaxy_state",
|
|
22
|
+
),
|
|
23
|
+
migrations.AddField(
|
|
24
|
+
model_name="invocation",
|
|
25
|
+
name="status",
|
|
26
|
+
field=models.CharField(
|
|
27
|
+
choices=[("running", "Running"), ("done", "Done")],
|
|
28
|
+
default="running",
|
|
29
|
+
max_length=10,
|
|
30
|
+
),
|
|
31
|
+
),
|
|
32
|
+
migrations.AlterField(
|
|
33
|
+
model_name="history",
|
|
34
|
+
name="create_time",
|
|
35
|
+
field=models.DateTimeField(),
|
|
36
|
+
),
|
|
37
|
+
]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Generated by Django 4.0.3 on 2022-07-26 09:55
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
import django.utils.timezone
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Migration(migrations.Migration):
|
|
8
|
+
|
|
9
|
+
dependencies = [
|
|
10
|
+
("django_to_galaxy", "0002_rename_state_history_galaxy_state_and_more"),
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
operations = [
|
|
14
|
+
migrations.AddField(
|
|
15
|
+
model_name="invocation",
|
|
16
|
+
name="create_time",
|
|
17
|
+
field=models.DateTimeField(default=django.utils.timezone.now),
|
|
18
|
+
preserve_default=False,
|
|
19
|
+
),
|
|
20
|
+
]
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Generated by Django 4.0.3 on 2022-08-01 12:47
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
import django.db.models.deletion
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Migration(migrations.Migration):
|
|
8
|
+
|
|
9
|
+
dependencies = [
|
|
10
|
+
("django_to_galaxy", "0003_invocation_create_time"),
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
operations = [
|
|
14
|
+
migrations.AlterField(
|
|
15
|
+
model_name="galaxyuser",
|
|
16
|
+
name="email",
|
|
17
|
+
field=models.EmailField(max_length=254),
|
|
18
|
+
),
|
|
19
|
+
migrations.CreateModel(
|
|
20
|
+
name="GalaxyOutputFile",
|
|
21
|
+
fields=[
|
|
22
|
+
(
|
|
23
|
+
"id",
|
|
24
|
+
models.BigAutoField(
|
|
25
|
+
auto_created=True,
|
|
26
|
+
primary_key=True,
|
|
27
|
+
serialize=False,
|
|
28
|
+
verbose_name="ID",
|
|
29
|
+
),
|
|
30
|
+
),
|
|
31
|
+
("galaxy_id", models.CharField(max_length=50)),
|
|
32
|
+
("workflow_name", models.CharField(max_length=200)),
|
|
33
|
+
("galaxy_state", models.CharField(max_length=100, null=True)),
|
|
34
|
+
("history_name", models.CharField(max_length=200, null=True)),
|
|
35
|
+
("src", models.CharField(max_length=50)),
|
|
36
|
+
(
|
|
37
|
+
"invocation",
|
|
38
|
+
models.ForeignKey(
|
|
39
|
+
on_delete=django.db.models.deletion.CASCADE,
|
|
40
|
+
related_name="outputs",
|
|
41
|
+
to="django_to_galaxy.invocation",
|
|
42
|
+
),
|
|
43
|
+
),
|
|
44
|
+
],
|
|
45
|
+
),
|
|
46
|
+
]
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Generated by Django 4.0.3 on 2022-08-03 12:58
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
import django.db.models.deletion
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class Migration(migrations.Migration):
|
|
8
|
+
|
|
9
|
+
dependencies = [
|
|
10
|
+
("django_to_galaxy", "0004_alter_galaxyuser_email_galaxyoutputfile"),
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
operations = [
|
|
14
|
+
migrations.AlterField(
|
|
15
|
+
model_name="galaxyoutputfile",
|
|
16
|
+
name="invocation",
|
|
17
|
+
field=models.ForeignKey(
|
|
18
|
+
on_delete=django.db.models.deletion.CASCADE,
|
|
19
|
+
related_name="output_files",
|
|
20
|
+
to="django_to_galaxy.invocation",
|
|
21
|
+
),
|
|
22
|
+
),
|
|
23
|
+
migrations.AlterField(
|
|
24
|
+
model_name="invocation",
|
|
25
|
+
name="status",
|
|
26
|
+
field=models.CharField(
|
|
27
|
+
choices=[
|
|
28
|
+
("running", "Running"),
|
|
29
|
+
("paused", "Paused"),
|
|
30
|
+
("error", "Error"),
|
|
31
|
+
("done", "Done"),
|
|
32
|
+
],
|
|
33
|
+
default="running",
|
|
34
|
+
max_length=10,
|
|
35
|
+
),
|
|
36
|
+
),
|
|
37
|
+
]
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Generated by Django 4.1 on 2023-03-02 10:15
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
|
|
8
|
+
dependencies = [
|
|
9
|
+
("django_to_galaxy", "0005_alter_galaxyoutputfile_invocation_and_more"),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
operations = [
|
|
13
|
+
migrations.CreateModel(
|
|
14
|
+
name="Tag",
|
|
15
|
+
fields=[
|
|
16
|
+
(
|
|
17
|
+
"id",
|
|
18
|
+
models.BigAutoField(
|
|
19
|
+
auto_created=True,
|
|
20
|
+
primary_key=True,
|
|
21
|
+
serialize=False,
|
|
22
|
+
verbose_name="ID",
|
|
23
|
+
),
|
|
24
|
+
),
|
|
25
|
+
("label", models.CharField(max_length=200, unique=True)),
|
|
26
|
+
],
|
|
27
|
+
),
|
|
28
|
+
migrations.AddField(
|
|
29
|
+
model_name="history",
|
|
30
|
+
name="tags",
|
|
31
|
+
field=models.ManyToManyField(
|
|
32
|
+
blank=True, null=True, to="django_to_galaxy.tag"
|
|
33
|
+
),
|
|
34
|
+
),
|
|
35
|
+
migrations.AddField(
|
|
36
|
+
model_name="workflow",
|
|
37
|
+
name="tags",
|
|
38
|
+
field=models.ManyToManyField(
|
|
39
|
+
blank=True, null=True, to="django_to_galaxy.tag"
|
|
40
|
+
),
|
|
41
|
+
),
|
|
42
|
+
]
|