def get_task_statistics(tasks, user):
    for task in tasks:
        task.started = (ImageAnnotation.objects.filter(task=task, user=user).count() > 0)
        task.finished = (task.number_of_annotated_images == task.total_number_of_images)
def get_task_statistics(tasks, user):
    for task in tasks:
        task.started = (ImageAnnotation.objects.filter(task=task, user=user).count() > 0)
        task.finished = (task.number_of_annotated_images == task.total_number_of_images)