Skip to content

Commit 9c8ccbd

Browse files
committed
feat: add canonicalize_substrates field to Job model and admin
1 parent 50d684d commit 9c8ccbd

4 files changed

Lines changed: 29 additions & 1 deletion

File tree

api/admin.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,22 @@ class JobAdmin(admin.ModelAdmin):
140140
"public_id",
141141
"user_ip",
142142
"prediction_type",
143+
"kcat_method",
144+
"km_method",
145+
"canonicalize_substrates",
143146
"status",
144147
"submission_time",
145148
"requested_rows",
146149
"download_links",
147150
]
148-
list_filter = ["status", "prediction_type", "submission_time"]
151+
list_filter = [
152+
"status",
153+
"prediction_type",
154+
"kcat_method",
155+
"km_method",
156+
"canonicalize_substrates",
157+
"submission_time",
158+
]
149159
search_fields = ["public_id", "ip_address", "user__ip_address"]
150160
readonly_fields = ["public_id", "submission_time", "download_links"]
151161

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from django.db import migrations, models
2+
3+
4+
class Migration(migrations.Migration):
5+
6+
dependencies = [
7+
("api", "0014_job_kcat_km_method_and_prediction_type_length"),
8+
]
9+
10+
operations = [
11+
migrations.AddField(
12+
model_name="job",
13+
name="canonicalize_substrates",
14+
field=models.BooleanField(default=True),
15+
),
16+
]

api/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class Job(models.Model):
6969
("skip", "skip"),
7070
],
7171
)
72+
canonicalize_substrates = models.BooleanField(default=True)
7273

7374
total_molecules = models.IntegerField(default=0)
7475
molecules_processed = models.IntegerField(default=0)

api/services/job_service.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ def create_job_record(
210210
kcat_method=params["methods"].get("kcat"),
211211
km_method=params["methods"].get("Km"),
212212
kcat_km_method=params["methods"].get("kcat/Km"),
213+
canonicalize_substrates=params.get("canonicalize_substrates", True),
213214
status="Pending",
214215
handle_long_sequences=params["handle_long_sequences"],
215216
ip_address=ip_address,

0 commit comments

Comments
 (0)