diff --git a/docs/CHANGELOG.rst b/docs/CHANGELOG.rst index 7333bbf79..7052230b0 100644 --- a/docs/CHANGELOG.rst +++ b/docs/CHANGELOG.rst @@ -27,6 +27,7 @@ Changed Fixed ----- +- Add status ``DataStatus.PROCESSING`` to the sort order =================== diff --git a/resolwe/flow/filters.py b/resolwe/flow/filters.py index 5d83381ce..46e8e6094 100644 --- a/resolwe/flow/filters.py +++ b/resolwe/flow/filters.py @@ -739,6 +739,9 @@ class AnnotationValueFilter(BaseResolweFilter): entity = FilterRelatedWithPermissions(EntityFilter) label = filters.CharFilter(method="filter_by_label") + def get_always_allowed_arguments(self): + return super().get_always_allowed_arguments() + ("time",) + def filter_by_label(self, queryset: QuerySet, name: str, value: str): """Filter by label.""" return queryset.filter(_value__label__icontains=value) diff --git a/resolwe/flow/migrations/0034_remove_data_idx_data_status_priority_and_more.py b/resolwe/flow/migrations/0034_remove_data_idx_data_status_priority_and_more.py new file mode 100644 index 000000000..ae505fe96 --- /dev/null +++ b/resolwe/flow/migrations/0034_remove_data_idx_data_status_priority_and_more.py @@ -0,0 +1,55 @@ +# Generated by Django 4.2.16 on 2024-12-12 08:01 + +from django.db import migrations, models + +import resolwe.flow.models.base + + +class Migration(migrations.Migration): + + dependencies = [ + ("flow", "0033_data_idx_data_status_priority"), + ] + + operations = [ + migrations.RemoveIndex( + model_name="data", + name="idx_data_status_priority", + ), + migrations.AddIndex( + model_name="data", + index=models.Index( + models.Case( + models.When( + status=resolwe.flow.models.base.DataStatus["ERROR"], + then=models.Value(0), + ), + models.When( + status=resolwe.flow.models.base.DataStatus["PROCESSING"], + then=models.Value(1), + ), + models.When( + status=resolwe.flow.models.base.DataStatus["UPLOADING"], + then=models.Value(2), + ), + models.When( + status=resolwe.flow.models.base.DataStatus["PREPARING"], + then=models.Value(3), + ), + models.When( + status=resolwe.flow.models.base.DataStatus["WAITING"], + then=models.Value(4), + ), + models.When( + status=resolwe.flow.models.base.DataStatus["RESOLVING"], + then=models.Value(5), + ), + models.When( + status=resolwe.flow.models.base.DataStatus["DONE"], + then=models.Value(6), + ), + ), + name="idx_data_status_priority", + ), + ), + ] diff --git a/resolwe/flow/models/base.py b/resolwe/flow/models/base.py index ba22bed68..7cfb65599 100644 --- a/resolwe/flow/models/base.py +++ b/resolwe/flow/models/base.py @@ -47,6 +47,7 @@ def sort_order(cls): """Return a priority for sorting data statuses in a collection.""" return [ cls.ERROR, + cls.PROCESSING, cls.UPLOADING, cls.PREPARING, cls.WAITING,