Browse Source

Merge pull request #1442 from rolisz/upload

Remove unneeded query
pull/1520/head
Hiroki Nakayama 3 years ago
committed by GitHub
parent
commit
583473b165
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 5 deletions
  1. 7
      backend/api/tasks.py

7
backend/api/tasks.py

@ -1,4 +1,3 @@
import datetime
import itertools
from celery import shared_task
@ -63,10 +62,8 @@ class DataFactory:
self.data_class(project=project, **example.data)
for example in examples
]
now = datetime.datetime.now()
self.data_class.objects.bulk_create(dataset)
ids = self.data_class.objects.filter(created_at__gte=now)
return list(ids)
results = self.data_class.objects.bulk_create(dataset)
return results
def create_annotation(self, examples, ids, user, project):
mapping = {label.text: label.id for label in project.labels.all()}

Loading…
Cancel
Save