-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimized jobs request #5962
Optimized jobs request #5962
Conversation
When an object is created, it doesn't have some optimized "count" values. In the case "count" values should be zero (.e.g new task doesn't have jobs).
@SpecLad , could you please look? |
cvat/apps/engine/serializers.py
Outdated
|
||
class Meta: | ||
model = models.Project | ||
fields = ('url', 'id', 'name', 'owner', 'assignee', | ||
'bug_tracker', 'task_subsets', 'created_date', 'updated_date', 'status', | ||
'dimension', 'organization', 'target_storage', 'source_storage', | ||
'tasks', 'labels', | ||
) | ||
'tasks', 'labels') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary change.
cvat/apps/engine/views.py
Outdated
queryset = Job.objects.select_related('assignee', 'segment__task__data', | ||
'segment__task__project').annotate(Count('issues', distinct=True), | ||
task_labels_count=Count('segment__task__label', | ||
filter=Q(segment__task__label__parent__isnull=True), distinct=True), | ||
proj_labels_count=Count('segment__task__project__label', | ||
filter=Q(segment__task__project__label__parent__isnull=True), distinct=True)).all() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you reformat this like in ProjectViewSet
? It's hard to understand which arguments are for what.
No description provided.