未验证 提交 297a9ccc 编写于 作者: M Maria Khrustaleva 提交者: GitHub

Fix order (#4087)

* Fix order

* Update header

* Update changelog

* Add Prefetch
Co-authored-by: NNikita Manovich <nikita.manovich@intel.com>
上级 59f0b3bb
......@@ -47,6 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added information to export CVAT_HOST when performing local installation for accessing over network (<https://github.com/openvinotoolkit/cvat/pull/4014>)
- Fixed possible color collisions in the generated colormap (<https://github.com/openvinotoolkit/cvat/pull/4007>)
- Original pdf file is deleted when using share (<https://github.com/openvinotoolkit/cvat/pull/3967>)
- Order in an annotation file(<https://github.com/openvinotoolkit/cvat/pull/4087>)
- Fixed task data upload progressbar (<https://github.com/openvinotoolkit/cvat/pull/4134>)
### Security
......
# Copyright (C) 2019-2020 Intel Corporation
# Copyright (C) 2019-2021 Intel Corporation
#
# SPDX-License-Identifier: MIT
......
......@@ -7,6 +7,7 @@ from collections import OrderedDict
from enum import Enum
from django.db import transaction
from django.db.models.query import Prefetch
from django.utils import timezone
from cvat.apps.engine import models, serializers
......@@ -547,7 +548,9 @@ class JobAnnotation:
class TaskAnnotation:
def __init__(self, pk):
self.db_task = models.Task.objects.prefetch_related("data__images").get(id=pk)
self.db_task = models.Task.objects.prefetch_related(
Prefetch('data__images', queryset=models.Image.objects.order_by('frame'))
).get(id=pk)
# Postgres doesn't guarantee an order by default without explicit order_by
self.db_jobs = models.Job.objects.select_related("segment").filter(segment__task_id=pk).order_by('id')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册