Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • arkindex/backend
1 result
Show changes
Commits on Source (18)
Showing
with 1407 additions and 1221 deletions
...@@ -18,8 +18,8 @@ include: ...@@ -18,8 +18,8 @@ include:
- .cache/pip - .cache/pip
before_script: before_script:
- pip install -r tests-requirements.txt - "echo database: {host: postgres, port: 5432} > $CONFIG_PATH"
- "echo 'database: {host: postgres, port: 5432}\npublic_hostname: http://ci.arkindex.localhost' > $CONFIG_PATH" - pip install -e .[test]
# Those jobs require the base image; they might fail if the image is not up to date. # Those jobs require the base image; they might fail if the image is not up to date.
# Allow them to fail when building a new base image, to prevent them from blocking a new base image build # Allow them to fail when building a new base image, to prevent them from blocking a new base image build
...@@ -58,7 +58,7 @@ backend-tests: ...@@ -58,7 +58,7 @@ backend-tests:
- test-report.xml - test-report.xml
script: script:
- python3 setup.py test - arkindex/manage.py test
backend-lint: backend-lint:
image: python:3.10 image: python:3.10
...@@ -91,7 +91,6 @@ backend-migrations: ...@@ -91,7 +91,6 @@ backend-migrations:
alias: postgres alias: postgres
script: script:
- pip install -e .
- arkindex/manage.py makemigrations --check --noinput --dry-run -v 3 - arkindex/manage.py makemigrations --check --noinput --dry-run -v 3
backend-openapi: backend-openapi:
......
...@@ -13,13 +13,10 @@ clean: ...@@ -13,13 +13,10 @@ clean:
find . -name '*.pyc' -exec rm {} \; find . -name '*.pyc' -exec rm {} \;
build: build:
CI_PROJECT_DIR=$(ROOT_DIR) CI_REGISTRY_IMAGE=$(IMAGE_TAG) $(ROOT_DIR)/ci/build.sh Dockerfile CI_PROJECT_DIR=$(ROOT_DIR) CI_REGISTRY_IMAGE=$(IMAGE_TAG) $(ROOT_DIR)/ci/build.sh
binary:
CI_PROJECT_DIR=$(ROOT_DIR) CI_REGISTRY_IMAGE=$(IMAGE_TAG) $(ROOT_DIR)/ci/build.sh Dockerfile.binary -binary
worker: worker:
arkindex/manage.py rqworker -v 2 default high arkindex/manage.py rqworker -v 2 default high tasks
test-fixtures: test-fixtures:
$(eval export PGPASSWORD=devdata) $(eval export PGPASSWORD=devdata)
......
...@@ -160,6 +160,11 @@ We use [rq](https://python-rq.org/), integrated via [django-rq](https://pypi.org ...@@ -160,6 +160,11 @@ We use [rq](https://python-rq.org/), integrated via [django-rq](https://pypi.org
To run them, use `make worker` to start a RQ worker. You will need to have Redis running; `make slim` or `make` in the architecture will provide it. `make` in the architecture also provides a RQ worker running in Docker from a binary build. To run them, use `make worker` to start a RQ worker. You will need to have Redis running; `make slim` or `make` in the architecture will provide it. `make` in the architecture also provides a RQ worker running in Docker from a binary build.
Process tasks are run in RQ by default (Community Edition). Two RQ workers must be running at the same time to actually run a process with worker activities, so the initialisation task can wait for the worker activity task to finish:
```sh
$ manage.py rqworker -v 3 default high & manage.py rqworker -v 3 tasks
```
## Metrics ## Metrics
The application serves metrics for Prometheus under the `/metrics` prefix. The application serves metrics for Prometheus under the `/metrics` prefix.
A specific port can be used by setting the `PROMETHEUS_METRICS_PORT` environment variable, thus separating the application from the metrics API. A specific port can be used by setting the `PROMETHEUS_METRICS_PORT` environment variable, thus separating the application from the metrics API.
1.6.0-alpha3 1.5.4
...@@ -1303,17 +1303,16 @@ class ElementNeighbors(ACLMixin, ListAPIView): ...@@ -1303,17 +1303,16 @@ class ElementNeighbors(ACLMixin, ListAPIView):
queryset = Element.objects.none() queryset = Element.objects.none()
def get_queryset(self): def get_queryset(self):
element = get_object_or_404( element = get_object_or_404(
# Include the attributes required for ACL checks and the API response # Include the attributes required for ACL checks and the API response
Element.objects.select_related("corpus", "type").only("id", "name", "type__slug", "corpus__public"), Element
.objects
.filter(corpus__in=Corpus.objects.readable(self.request.user))
.select_related("corpus", "type")
.only("id", "name", "type__slug", "corpus__public"),
id=self.kwargs["pk"] id=self.kwargs["pk"]
) )
# Check access permission
if not self.has_access(element.corpus, Role.Guest.value):
raise PermissionDenied(detail="You do not have a read access to this element.")
return Element.objects.get_neighbors(element) return Element.objects.get_neighbors(element)
...@@ -2193,6 +2192,14 @@ class CorpusSelectionDestroy(CorpusACLMixin, SelectionMixin, DestroyAPIView): ...@@ -2193,6 +2192,14 @@ class CorpusSelectionDestroy(CorpusACLMixin, SelectionMixin, DestroyAPIView):
delete=extend_schema( delete=extend_schema(
operation_id="DestroyWorkerResults", operation_id="DestroyWorkerResults",
parameters=[ parameters=[
OpenApiParameter(
"worker_run_id",
type=UUID,
required=False,
description="Only delete Worker Results produced by a specific worker run. "
"If this parameter is set, any `worker_version_id`, `model_version_id` "
"or `configuration_id` parameters will be ignored.",
),
OpenApiParameter( OpenApiParameter(
"worker_version_id", "worker_version_id",
type=UUID, type=UUID,
...@@ -2233,38 +2240,30 @@ class CorpusSelectionDestroy(CorpusACLMixin, SelectionMixin, DestroyAPIView): ...@@ -2233,38 +2240,30 @@ class CorpusSelectionDestroy(CorpusACLMixin, SelectionMixin, DestroyAPIView):
) )
class WorkerResultsDestroy(CorpusACLMixin, DestroyAPIView): class WorkerResultsDestroy(CorpusACLMixin, DestroyAPIView):
""" """
Delete all Worker Results from all WorkerVersions or a specific one Delete all Worker Results, or Worker Results produced by specific WorkerRuns or WorkerVersions
on a Corpus or under a specified parent element (parent element included) (the results to delete can also be filtered by ModelVersion and Configuration)
on a Corpus, the selection, or under a specified parent element (parent element included)
""" """
permission_classes = (IsVerified, ) permission_classes = (IsVerified, )
# https://github.com/tfranzel/drf-spectacular/issues/308 def results_filters(self):
@extend_schema(responses={204: None})
def delete(self, request, *args, **kwargs):
corpus = self.get_corpus(self.kwargs["corpus"], role=Role.Admin)
errors = defaultdict(list) errors = defaultdict(list)
use_selection = self.request.query_params.get("use_selection", "false").lower() not in ("false", "0") if "worker_run_id" in self.request.query_params:
if use_selection:
# Only check for selected elements if the selection feature is enabled
if settings.ARKINDEX_FEATURES["selection"]:
if "element_id" in self.request.query_params:
errors["use_selection"].append("use_selection and element_id cannot be used simultaneously.")
if not self.request.user.selected_elements.filter(corpus=corpus).exists():
errors["use_selection"].append("No elements of the specified corpus have been selected.")
else:
errors["use_selection"].append("Selection is not available on this instance.")
element_id = None
if "element_id" in self.request.query_params:
try: try:
element_id = UUID(self.request.query_params["element_id"]) worker_run_id = UUID(self.request.query_params["worker_run_id"])
except (TypeError, ValueError): except (TypeError, ValueError):
errors["element_id"].append("Invalid UUID.") raise ValidationError({"worker_run_id": ["Invalid UUID."]})
else: else:
if not corpus.elements.filter(id=element_id).exists(): try:
errors["element_id"].append("This element does not exist in the specified corpus.") worker_run = WorkerRun.objects.get(id=worker_run_id)
except WorkerRun.DoesNotExist:
raise ValidationError({"worker_run_id": ["This worker run does not exist."]})
# Ignore the other parameters when a worker run ID is set
return {
"worker_run": worker_run,
}
worker_version = None worker_version = None
if "worker_version_id" in self.request.query_params: if "worker_version_id" in self.request.query_params:
...@@ -2314,22 +2313,60 @@ class WorkerResultsDestroy(CorpusACLMixin, DestroyAPIView): ...@@ -2314,22 +2313,60 @@ class WorkerResultsDestroy(CorpusACLMixin, DestroyAPIView):
if errors: if errors:
raise ValidationError(errors) raise ValidationError(errors)
return {
"version": worker_version,
"model_version": model_version,
"configuration": configuration
}
# https://github.com/tfranzel/drf-spectacular/issues/308
@extend_schema(responses={204: None})
def delete(self, request, *args, **kwargs):
corpus = self.get_corpus(self.kwargs["corpus"], role=Role.Admin)
errors = defaultdict(list)
use_selection = self.request.query_params.get("use_selection", "false").lower() not in ("false", "0")
if use_selection:
# Only check for selected elements if the selection feature is enabled
if settings.ARKINDEX_FEATURES["selection"]:
if "element_id" in self.request.query_params:
errors["use_selection"].append("use_selection and element_id cannot be used simultaneously.")
if not self.request.user.selected_elements.filter(corpus=corpus).exists():
errors["use_selection"].append("No elements of the specified corpus have been selected.")
else:
errors["use_selection"].append("Selection is not available on this instance.")
element_id = None
if "element_id" in self.request.query_params:
try:
element_id = UUID(self.request.query_params["element_id"])
except (TypeError, ValueError):
errors["element_id"].append("Invalid UUID.")
else:
if not corpus.elements.filter(id=element_id).exists():
errors["element_id"].append("This element does not exist in the specified corpus.")
try:
filters = self.results_filters()
except ValidationError as errs:
errors = errors | errs.detail
if errors:
raise ValidationError(errors)
if use_selection: if use_selection:
selection_worker_results_delete( selection_worker_results_delete(
corpus=corpus, corpus=corpus,
version=worker_version,
model_version=model_version,
configuration=configuration,
user_id=self.request.user.id, user_id=self.request.user.id,
**filters
) )
else: else:
worker_results_delete( worker_results_delete(
corpus_id=corpus.id, corpus_id=corpus.id,
version=worker_version,
element_id=element_id, element_id=element_id,
model_version=model_version,
configuration=configuration,
user_id=self.request.user.id, user_id=self.request.user.id,
**filters
) )
return Response(status=status.HTTP_204_NO_CONTENT) return Response(status=status.HTTP_204_NO_CONTENT)
......
[ [
{ {
"model": "process.process", "model": "process.process",
"pk": "245bc206-350c-43d5-8db3-d98645c4eaa9", "pk": "26050593-712f-4f7a-b15a-4d2132241514",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"name": null, "name": "Process fixture",
"creator": 1, "creator": 2,
"corpus": null, "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"mode": "repository", "mode": "workers",
"revision": null, "revision": null,
"activity_state": "disabled", "activity_state": "disabled",
"started": null, "started": null,
"finished": null, "finished": null,
"farm": "c19116b6-866f-4bb7-b447-3544629a8151", "farm": "94055f35-9ac9-44a0-ac5d-386e132bea2c",
"element": null, "element": null,
"folder_type": null, "folder_type": null,
"element_type": null, "element_type": null,
...@@ -32,19 +32,19 @@ ...@@ -32,19 +32,19 @@
}, },
{ {
"model": "process.process", "model": "process.process",
"pk": "64b06ffd-a8c4-4ba2-bbb5-c99eb99121a0", "pk": "3421ba72-b14c-4df0-a504-1e7e90abe4b4",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"name": "Process fixture", "name": null,
"creator": 2, "creator": 1,
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": null,
"mode": "workers", "mode": "repository",
"revision": null, "revision": null,
"activity_state": "disabled", "activity_state": "disabled",
"started": null, "started": null,
"finished": null, "finished": null,
"farm": "c19116b6-866f-4bb7-b447-3544629a8151", "farm": "94055f35-9ac9-44a0-ac5d-386e132bea2c",
"element": null, "element": null,
"folder_type": null, "folder_type": null,
"element_type": null, "element_type": null,
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
}, },
{ {
"model": "process.process", "model": "process.process",
"pk": "98e30036-bd74-4480-82c0-98c3199a4503", "pk": "4a3c1857-7fe7-47ba-9e47-7ce96eefc96f",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
}, },
{ {
"model": "process.process", "model": "process.process",
"pk": "e395a111-ab5a-4c93-8901-b1f8bafde684", "pk": "be97d04e-0af4-4043-9874-d20f28b30431",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
...@@ -125,182 +125,184 @@ ...@@ -125,182 +125,184 @@
}, },
{ {
"model": "process.repository", "model": "process.repository",
"pk": "6a07d21c-cc43-4c2b-8c72-5105a0399055", "pk": "0e1654c4-20e5-4d4a-99ab-7142040b6e88",
"fields": { "fields": {
"url": "http://my_repo.fake/workers/worker" "url": "http://gitlab/repo"
} }
}, },
{ {
"model": "process.repository", "model": "process.repository",
"pk": "b44445fb-1586-4673-b61c-c8057ccc9878", "pk": "a091592f-0ea9-4147-be4e-4f580751ac9f",
"fields": { "fields": {
"url": "http://gitlab/repo" "url": "http://my_repo.fake/workers/worker"
} }
}, },
{ {
"model": "process.revision", "model": "process.revision",
"pk": "5f17c014-45e6-416e-9a6e-86a5de0f79c5", "pk": "539e2eb4-6180-4d45-bc2f-ddd4bbe08ab1",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"repo": "b44445fb-1586-4673-b61c-c8057ccc9878", "repo": "a091592f-0ea9-4147-be4e-4f580751ac9f",
"hash": "42", "hash": "1337",
"message": "Salve", "message": "My w0rk3r",
"author": "Some user" "author": "Test user"
} }
}, },
{ {
"model": "process.revision", "model": "process.revision",
"pk": "88be293e-5e58-4b60-8438-3feaf38c0f12", "pk": "d2d52ec9-2d56-4df1-9118-ed884f26cb83",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"repo": "6a07d21c-cc43-4c2b-8c72-5105a0399055", "repo": "0e1654c4-20e5-4d4a-99ab-7142040b6e88",
"hash": "1337", "hash": "42",
"message": "My w0rk3r", "message": "Salve",
"author": "Test user" "author": "Some user"
} }
}, },
{ {
"model": "process.worker", "model": "process.worker",
"pk": "19c68046-9fde-4aa6-804d-d3888205722a", "pk": "5a6c0c92-b9b1-4a69-a8d0-b75841cd0193",
"fields": { "fields": {
"name": "Generic worker with a Model", "name": "File import",
"slug": "generic", "slug": "file_import",
"type": "189c3b32-1172-4a79-b9a2-3cb14f7f52e3", "type": "2c4d9006-9c1f-4a62-944d-a8862aa022b1",
"description": "", "description": "",
"repository": "6a07d21c-cc43-4c2b-8c72-5105a0399055", "repository": "a091592f-0ea9-4147-be4e-4f580751ac9f",
"public": false, "public": false,
"archived": null "archived": null
} }
}, },
{ {
"model": "process.worker", "model": "process.worker",
"pk": "1ab3c191-f306-4c6b-89b5-5d41a50a3d22", "pk": "7458bec4-665b-4e2d-862f-7d87bc833481",
"fields": { "fields": {
"name": "Document layout analyser", "name": "Custom worker",
"slug": "dla", "slug": "custom",
"type": "c804b4ef-b2ed-4b82-90c6-fb020e3542d8", "type": "9785b33d-d517-4a91-a4d9-b192e6b042b6",
"description": "", "description": "",
"repository": "6a07d21c-cc43-4c2b-8c72-5105a0399055", "repository": null,
"public": false, "public": false,
"archived": null "archived": null
} }
}, },
{ {
"model": "process.worker", "model": "process.worker",
"pk": "5a12340d-c2b9-4d28-800b-6563fb9f6bec", "pk": "89964ea9-97a3-4edf-8568-545ea810342e",
"fields": { "fields": {
"name": "Recognizer", "name": "Document layout analyser",
"slug": "reco", "slug": "dla",
"type": "189c3b32-1172-4a79-b9a2-3cb14f7f52e3", "type": "3b3adc81-73f1-4e92-8093-d1dd9431c53f",
"description": "", "description": "",
"repository": "6a07d21c-cc43-4c2b-8c72-5105a0399055", "repository": "a091592f-0ea9-4147-be4e-4f580751ac9f",
"public": false, "public": false,
"archived": null "archived": null
} }
}, },
{ {
"model": "process.worker", "model": "process.worker",
"pk": "62666365-d37d-4e30-91ad-723405dbdc8e", "pk": "c7439e52-9b09-489b-8dc5-13994801e8ac",
"fields": { "fields": {
"name": "Worker requiring a GPU", "name": "Worker requiring a GPU",
"slug": "worker-gpu", "slug": "worker-gpu",
"type": "429e7774-99cd-4672-9438-7d576a69a1a4", "type": "4696efe7-e3dd-4a8c-8346-c99d479c1756",
"description": "", "description": "",
"repository": "6a07d21c-cc43-4c2b-8c72-5105a0399055", "repository": "a091592f-0ea9-4147-be4e-4f580751ac9f",
"public": false, "public": false,
"archived": null "archived": null
} }
}, },
{ {
"model": "process.worker", "model": "process.worker",
"pk": "bf76d80a-ca52-47e2-8670-2d60c1a675b0", "pk": "c88cf97b-25a1-4074-a88c-8d2b7a82db8c",
"fields": { "fields": {
"name": "Custom worker", "name": "Recognizer",
"slug": "custom", "slug": "reco",
"type": "2b2c3dae-98be-42c3-927b-28440f8df5d0", "type": "999707eb-4c53-469d-8fb6-ec6a80010248",
"description": "", "description": "",
"repository": null, "repository": "a091592f-0ea9-4147-be4e-4f580751ac9f",
"public": false, "public": false,
"archived": null "archived": null
} }
}, },
{ {
"model": "process.worker", "model": "process.worker",
"pk": "e61fde1d-e5bb-4188-aefa-1ceb04fa34a7", "pk": "f62b2ea5-7bff-4c38-9bd1-7237543cad36",
"fields": { "fields": {
"name": "File import", "name": "Generic worker with a Model",
"slug": "file_import", "slug": "generic",
"type": "2164e147-3109-4a68-93d7-d68341dedfb2", "type": "999707eb-4c53-469d-8fb6-ec6a80010248",
"description": "", "description": "",
"repository": "6a07d21c-cc43-4c2b-8c72-5105a0399055", "repository": "a091592f-0ea9-4147-be4e-4f580751ac9f",
"public": false, "public": false,
"archived": null "archived": null
} }
}, },
{ {
"model": "process.workertype", "model": "process.workertype",
"pk": "189c3b32-1172-4a79-b9a2-3cb14f7f52e3", "pk": "2c4d9006-9c1f-4a62-944d-a8862aa022b1",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"slug": "recognizer", "slug": "import",
"display_name": "Recognizer" "display_name": "Import"
} }
}, },
{ {
"model": "process.workertype", "model": "process.workertype",
"pk": "2164e147-3109-4a68-93d7-d68341dedfb2", "pk": "3b3adc81-73f1-4e92-8093-d1dd9431c53f",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"slug": "import", "slug": "dla",
"display_name": "Import" "display_name": "Document Layout Analysis"
} }
}, },
{ {
"model": "process.workertype", "model": "process.workertype",
"pk": "2b2c3dae-98be-42c3-927b-28440f8df5d0", "pk": "4696efe7-e3dd-4a8c-8346-c99d479c1756",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"slug": "custom", "slug": "worker",
"display_name": "Custom" "display_name": "Worker requiring a GPU"
} }
}, },
{ {
"model": "process.workertype", "model": "process.workertype",
"pk": "429e7774-99cd-4672-9438-7d576a69a1a4", "pk": "9785b33d-d517-4a91-a4d9-b192e6b042b6",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"slug": "worker", "slug": "custom",
"display_name": "Worker requiring a GPU" "display_name": "Custom"
} }
}, },
{ {
"model": "process.workertype", "model": "process.workertype",
"pk": "c804b4ef-b2ed-4b82-90c6-fb020e3542d8", "pk": "999707eb-4c53-469d-8fb6-ec6a80010248",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"slug": "dla", "slug": "recognizer",
"display_name": "Document Layout Analysis" "display_name": "Recognizer"
} }
}, },
{ {
"model": "process.workerversion", "model": "process.workerversion",
"pk": "1e0dee90-0973-4017-b23d-4d972d7cfc09", "pk": "06e2171f-b7d6-49dc-90fc-d47784e6e334",
"fields": { "fields": {
"worker": "e61fde1d-e5bb-4188-aefa-1ceb04fa34a7", "worker": "c88cf97b-25a1-4074-a88c-8d2b7a82db8c",
"revision": "88be293e-5e58-4b60-8438-3feaf38c0f12", "revision": "539e2eb4-6180-4d45-bc2f-ddd4bbe08ab1",
"version": null, "version": null,
"configuration": {}, "configuration": {
"test": 42
},
"state": "available", "state": "available",
"gpu_usage": "disabled", "gpu_usage": "disabled",
"model_usage": "disabled", "model_usage": "disabled",
"docker_image": "9a1b1d5d-ec3d-4a21-89da-0e930292467d", "docker_image": "492ea45f-2c2d-4bf3-a461-016204fcfb03",
"docker_image_iid": null, "docker_image_iid": null,
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z" "updated": "2020-02-02T01:23:45.678Z"
...@@ -308,9 +310,9 @@ ...@@ -308,9 +310,9 @@
}, },
{ {
"model": "process.workerversion", "model": "process.workerversion",
"pk": "5ce2dcd8-f35e-41d1-bd73-b40c9661db77", "pk": "23473bff-4362-466e-ba5f-b6843df1fdf3",
"fields": { "fields": {
"worker": "bf76d80a-ca52-47e2-8670-2d60c1a675b0", "worker": "7458bec4-665b-4e2d-862f-7d87bc833481",
"revision": null, "revision": null,
"version": 1, "version": 1,
"configuration": { "configuration": {
...@@ -327,18 +329,18 @@ ...@@ -327,18 +329,18 @@
}, },
{ {
"model": "process.workerversion", "model": "process.workerversion",
"pk": "70b6b804-b6f9-4efb-9d79-b8258c336eb7", "pk": "2aa45507-c5f2-4e1f-bc38-edf50dbf5aae",
"fields": { "fields": {
"worker": "5a12340d-c2b9-4d28-800b-6563fb9f6bec", "worker": "f62b2ea5-7bff-4c38-9bd1-7237543cad36",
"revision": "88be293e-5e58-4b60-8438-3feaf38c0f12", "revision": "539e2eb4-6180-4d45-bc2f-ddd4bbe08ab1",
"version": null, "version": null,
"configuration": { "configuration": {
"test": 42 "test": 42
}, },
"state": "available", "state": "available",
"gpu_usage": "disabled", "gpu_usage": "disabled",
"model_usage": "disabled", "model_usage": "required",
"docker_image": "9a1b1d5d-ec3d-4a21-89da-0e930292467d", "docker_image": "492ea45f-2c2d-4bf3-a461-016204fcfb03",
"docker_image_iid": null, "docker_image_iid": null,
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z" "updated": "2020-02-02T01:23:45.678Z"
...@@ -346,10 +348,10 @@ ...@@ -346,10 +348,10 @@
}, },
{ {
"model": "process.workerversion", "model": "process.workerversion",
"pk": "79d83370-d164-4052-bb29-18f475916ea4", "pk": "66d545f5-4f60-436a-9cc3-517504cce152",
"fields": { "fields": {
"worker": "62666365-d37d-4e30-91ad-723405dbdc8e", "worker": "c7439e52-9b09-489b-8dc5-13994801e8ac",
"revision": "88be293e-5e58-4b60-8438-3feaf38c0f12", "revision": "539e2eb4-6180-4d45-bc2f-ddd4bbe08ab1",
"version": null, "version": null,
"configuration": { "configuration": {
"test": 42 "test": 42
...@@ -357,7 +359,7 @@ ...@@ -357,7 +359,7 @@
"state": "available", "state": "available",
"gpu_usage": "required", "gpu_usage": "required",
"model_usage": "disabled", "model_usage": "disabled",
"docker_image": "9a1b1d5d-ec3d-4a21-89da-0e930292467d", "docker_image": "492ea45f-2c2d-4bf3-a461-016204fcfb03",
"docker_image_iid": null, "docker_image_iid": null,
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z" "updated": "2020-02-02T01:23:45.678Z"
...@@ -365,18 +367,18 @@ ...@@ -365,18 +367,18 @@
}, },
{ {
"model": "process.workerversion", "model": "process.workerversion",
"pk": "9e43ea6a-3f53-4a54-9a66-8f1699570f59", "pk": "7e54d670-f1f2-4b96-a38a-ac6a5416ea72",
"fields": { "fields": {
"worker": "19c68046-9fde-4aa6-804d-d3888205722a", "worker": "89964ea9-97a3-4edf-8568-545ea810342e",
"revision": "88be293e-5e58-4b60-8438-3feaf38c0f12", "revision": "539e2eb4-6180-4d45-bc2f-ddd4bbe08ab1",
"version": null, "version": null,
"configuration": { "configuration": {
"test": 42 "test": 42
}, },
"state": "available", "state": "available",
"gpu_usage": "disabled", "gpu_usage": "disabled",
"model_usage": "required", "model_usage": "disabled",
"docker_image": "9a1b1d5d-ec3d-4a21-89da-0e930292467d", "docker_image": "492ea45f-2c2d-4bf3-a461-016204fcfb03",
"docker_image_iid": null, "docker_image_iid": null,
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z" "updated": "2020-02-02T01:23:45.678Z"
...@@ -384,18 +386,16 @@ ...@@ -384,18 +386,16 @@
}, },
{ {
"model": "process.workerversion", "model": "process.workerversion",
"pk": "b0db756e-b291-4ffe-99c7-cd347741d7db", "pk": "88a1c9ce-3128-4219-a120-9ea9574316a3",
"fields": { "fields": {
"worker": "1ab3c191-f306-4c6b-89b5-5d41a50a3d22", "worker": "5a6c0c92-b9b1-4a69-a8d0-b75841cd0193",
"revision": "88be293e-5e58-4b60-8438-3feaf38c0f12", "revision": "539e2eb4-6180-4d45-bc2f-ddd4bbe08ab1",
"version": null, "version": null,
"configuration": { "configuration": {},
"test": 42
},
"state": "available", "state": "available",
"gpu_usage": "disabled", "gpu_usage": "disabled",
"model_usage": "disabled", "model_usage": "disabled",
"docker_image": "9a1b1d5d-ec3d-4a21-89da-0e930292467d", "docker_image": "492ea45f-2c2d-4bf3-a461-016204fcfb03",
"docker_image_iid": null, "docker_image_iid": null,
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z" "updated": "2020-02-02T01:23:45.678Z"
...@@ -403,14 +403,14 @@ ...@@ -403,14 +403,14 @@
}, },
{ {
"model": "process.workerrun", "model": "process.workerrun",
"pk": "4b931fc3-4c2b-44ea-8743-4907915554bb", "pk": "796a41f5-9797-443d-be13-ea73372e4950",
"fields": { "fields": {
"process": "64b06ffd-a8c4-4ba2-bbb5-c99eb99121a0", "process": "4a3c1857-7fe7-47ba-9e47-7ce96eefc96f",
"version": "b0db756e-b291-4ffe-99c7-cd347741d7db", "version": "23473bff-4362-466e-ba5f-b6843df1fdf3",
"model_version": null, "model_version": null,
"parents": "[]", "parents": "[]",
"configuration": null, "configuration": null,
"summary": "Worker Document layout analyser @ b0db75", "summary": "Worker Custom worker @ version 1",
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"has_results": false "has_results": false
...@@ -418,14 +418,14 @@ ...@@ -418,14 +418,14 @@
}, },
{ {
"model": "process.workerrun", "model": "process.workerrun",
"pk": "4d26aa77-969b-4734-9260-a52b63d6a1d6", "pk": "9b99e704-47e6-478c-988f-323c636bb91a",
"fields": { "fields": {
"process": "64b06ffd-a8c4-4ba2-bbb5-c99eb99121a0", "process": "26050593-712f-4f7a-b15a-4d2132241514",
"version": "70b6b804-b6f9-4efb-9d79-b8258c336eb7", "version": "7e54d670-f1f2-4b96-a38a-ac6a5416ea72",
"model_version": null, "model_version": null,
"parents": "[\"4b931fc3-4c2b-44ea-8743-4907915554bb\"]", "parents": "[]",
"configuration": null, "configuration": null,
"summary": "Worker Recognizer @ 70b6b8", "summary": "Worker Document layout analyser @ 7e54d6",
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"has_results": false "has_results": false
...@@ -433,14 +433,14 @@ ...@@ -433,14 +433,14 @@
}, },
{ {
"model": "process.workerrun", "model": "process.workerrun",
"pk": "83959955-af5d-459f-8e33-47b39e256852", "pk": "810d22b3-90bf-44bb-a931-9c20d6b600ca",
"fields": { "fields": {
"process": "e395a111-ab5a-4c93-8901-b1f8bafde684", "process": "26050593-712f-4f7a-b15a-4d2132241514",
"version": "5ce2dcd8-f35e-41d1-bd73-b40c9661db77", "version": "06e2171f-b7d6-49dc-90fc-d47784e6e334",
"model_version": null, "model_version": null,
"parents": "[]", "parents": "[\"9b99e704-47e6-478c-988f-323c636bb91a\"]",
"configuration": null, "configuration": null,
"summary": "Worker Custom worker @ version 1", "summary": "Worker Recognizer @ 06e217",
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"has_results": false "has_results": false
...@@ -448,10 +448,10 @@ ...@@ -448,10 +448,10 @@
}, },
{ {
"model": "process.workerrun", "model": "process.workerrun",
"pk": "86240072-39ba-4597-a7a5-9078f3134657", "pk": "9c5e8955-084a-4dd4-a816-c74d2ac0ab49",
"fields": { "fields": {
"process": "98e30036-bd74-4480-82c0-98c3199a4503", "process": "be97d04e-0af4-4043-9874-d20f28b30431",
"version": "5ce2dcd8-f35e-41d1-bd73-b40c9661db77", "version": "23473bff-4362-466e-ba5f-b6843df1fdf3",
"model_version": null, "model_version": null,
"parents": "[]", "parents": "[]",
"configuration": null, "configuration": null,
...@@ -463,7 +463,7 @@ ...@@ -463,7 +463,7 @@
}, },
{ {
"model": "documents.corpus", "model": "documents.corpus",
"pk": "fdbe4b5c-9475-4310-8877-eb07344e294a", "pk": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
...@@ -476,11 +476,11 @@ ...@@ -476,11 +476,11 @@
}, },
{ {
"model": "documents.elementtype", "model": "documents.elementtype",
"pk": "3bbbd33a-b906-4526-9e0b-0643ade1b080", "pk": "097f73b9-4ea7-4063-98b0-e17eb698e77a",
"fields": { "fields": {
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"slug": "word", "slug": "text_line",
"display_name": "Word", "display_name": "Line",
"folder": false, "folder": false,
"indexable": false, "indexable": false,
"color": "28b62c" "color": "28b62c"
...@@ -488,9 +488,9 @@ ...@@ -488,9 +488,9 @@
}, },
{ {
"model": "documents.elementtype", "model": "documents.elementtype",
"pk": "4200ad41-d032-476a-acb4-943e6481ee6d", "pk": "60e8c1f1-c04d-49b6-bc6e-70e38e437f36",
"fields": { "fields": {
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"slug": "volume", "slug": "volume",
"display_name": "Volume", "display_name": "Volume",
"folder": true, "folder": true,
...@@ -500,11 +500,11 @@ ...@@ -500,11 +500,11 @@
}, },
{ {
"model": "documents.elementtype", "model": "documents.elementtype",
"pk": "634e6aee-87a1-4845-a63e-83e7226aa557", "pk": "aa7b5e5a-eaa3-49b5-8c7a-826941c9d472",
"fields": { "fields": {
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"slug": "text_line", "slug": "word",
"display_name": "Line", "display_name": "Word",
"folder": false, "folder": false,
"indexable": false, "indexable": false,
"color": "28b62c" "color": "28b62c"
...@@ -512,11 +512,11 @@ ...@@ -512,11 +512,11 @@
}, },
{ {
"model": "documents.elementtype", "model": "documents.elementtype",
"pk": "7afe34f9-ad57-4ce7-872a-4d9aa31b6d0b", "pk": "c6267733-b1ce-4ea3-ac20-3a18c3d66f24",
"fields": { "fields": {
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"slug": "page", "slug": "act",
"display_name": "Page", "display_name": "Act",
"folder": false, "folder": false,
"indexable": false, "indexable": false,
"color": "28b62c" "color": "28b62c"
...@@ -524,11 +524,11 @@ ...@@ -524,11 +524,11 @@
}, },
{ {
"model": "documents.elementtype", "model": "documents.elementtype",
"pk": "bc871e02-a23f-4799-a4d7-bb81813f41f5", "pk": "f2d75650-9d48-4b6e-b210-dbd595a668d2",
"fields": { "fields": {
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"slug": "surface", "slug": "page",
"display_name": "Surface", "display_name": "Page",
"folder": false, "folder": false,
"indexable": false, "indexable": false,
"color": "28b62c" "color": "28b62c"
...@@ -536,11 +536,11 @@ ...@@ -536,11 +536,11 @@
}, },
{ {
"model": "documents.elementtype", "model": "documents.elementtype",
"pk": "eda3da9f-1a6b-4f7a-91d1-f28e4e74f76a", "pk": "fb9cf6d3-b31a-449c-a780-2f5db501695f",
"fields": { "fields": {
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"slug": "act", "slug": "surface",
"display_name": "Act", "display_name": "Surface",
"folder": false, "folder": false,
"indexable": false, "indexable": false,
"color": "28b62c" "color": "28b62c"
...@@ -548,279 +548,279 @@ ...@@ -548,279 +548,279 @@
}, },
{ {
"model": "documents.elementpath", "model": "documents.elementpath",
"pk": "04489822-c85b-4ac8-8d59-f7e1ac914295", "pk": "13930713-e133-4d00-90fe-7169541b6b8c",
"fields": {
"element": "6c6a774e-88c3-40c5-9913-d7ec2a3d5125",
"path": "[\"3bcfeab1-e4d4-4f63-8f60-8fc5fc551a64\"]",
"ordering": 0
}
},
{
"model": "documents.elementpath",
"pk": "0a801b84-7243-4ee0-857a-446a6af3ae97",
"fields": { "fields": {
"element": "3bcfeab1-e4d4-4f63-8f60-8fc5fc551a64", "element": "1f20a3a4-33be-43a3-9427-393799aba6d7",
"path": "[]", "path": "[\"12e84ea0-004a-43e7-9fcc-85021e2407a9\", \"737db4ff-8119-4e12-be99-968d7fa3be22\"]",
"ordering": 0 "ordering": 0
} }
}, },
{ {
"model": "documents.elementpath", "model": "documents.elementpath",
"pk": "0aad9073-0d49-492e-8455-4bd99e492e89", "pk": "250c8b60-16ac-49c9-ba2a-ee157d387077",
"fields": { "fields": {
"element": "469f4606-f5ea-406d-a0bd-6d48050c39ed", "element": "60a6c062-1bbb-4e5f-82e7-37cb77d92419",
"path": "[\"3bcfeab1-e4d4-4f63-8f60-8fc5fc551a64\", \"4d2f59fe-9808-44b1-b3b5-017490ae4064\"]", "path": "[\"12e84ea0-004a-43e7-9fcc-85021e2407a9\", \"67482d70-765b-4092-b462-2d955fd8a7df\"]",
"ordering": 0 "ordering": 2
} }
}, },
{ {
"model": "documents.elementpath", "model": "documents.elementpath",
"pk": "2a801688-b438-4234-a1de-4b06553f1d55", "pk": "2d34a587-68b2-4087-a05e-d92c5bc0b086",
"fields": { "fields": {
"element": "d3dc3f63-9894-434b-9715-7bd906b63e63", "element": "6452b6c6-3d58-48c2-9032-691095fe8317",
"path": "[\"3bcfeab1-e4d4-4f63-8f60-8fc5fc551a64\", \"6c6a774e-88c3-40c5-9913-d7ec2a3d5125\"]", "path": "[\"12e84ea0-004a-43e7-9fcc-85021e2407a9\", \"67482d70-765b-4092-b462-2d955fd8a7df\"]",
"ordering": 0 "ordering": 1
} }
}, },
{ {
"model": "documents.elementpath", "model": "documents.elementpath",
"pk": "394d7eca-1ccc-47a4-ae44-8dd33c9ceb17", "pk": "33cdaa32-f9fe-4d60-91af-6200f90915af",
"fields": { "fields": {
"element": "60313262-3273-4c39-a8ee-cedc733f6990", "element": "737db4ff-8119-4e12-be99-968d7fa3be22",
"path": "[\"7a007e29-b509-4c4e-8321-78464df6f03a\"]", "path": "[\"12e84ea0-004a-43e7-9fcc-85021e2407a9\"]",
"ordering": 0 "ordering": 2
} }
}, },
{ {
"model": "documents.elementpath", "model": "documents.elementpath",
"pk": "3d71eb28-24c5-4028-a72b-a3c170c117eb", "pk": "344c8906-d207-48cc-9d5b-5c738758e510",
"fields": { "fields": {
"element": "17a65610-023b-46c7-93a6-453335626d17", "element": "66843ee4-559b-4d2d-a9ce-4dd425022159",
"path": "[\"3bcfeab1-e4d4-4f63-8f60-8fc5fc551a64\", \"6c6a774e-88c3-40c5-9913-d7ec2a3d5125\"]", "path": "[\"12e84ea0-004a-43e7-9fcc-85021e2407a9\", \"737db4ff-8119-4e12-be99-968d7fa3be22\"]",
"ordering": 3 "ordering": 1
} }
}, },
{ {
"model": "documents.elementpath", "model": "documents.elementpath",
"pk": "4cd70fa4-1e6e-452a-8212-4be6138a6b34", "pk": "36612194-8586-43a3-9114-b3fa5d4c7832",
"fields": { "fields": {
"element": "c16df32e-03b5-47e4-868f-98d57eac1f15", "element": "8349d4ba-fd23-4da6-a99b-76ba2e359b6f",
"path": "[\"7a007e29-b509-4c4e-8321-78464df6f03a\"]", "path": "[\"12e84ea0-004a-43e7-9fcc-85021e2407a9\"]",
"ordering": 1 "ordering": 5
} }
}, },
{ {
"model": "documents.elementpath", "model": "documents.elementpath",
"pk": "4e407215-0ed2-4ff2-98ff-a22d6b23349a", "pk": "37f898d5-0a9a-49df-b8f6-40761f18c734",
"fields": { "fields": {
"element": "a8c108a2-a6b7-4401-9d64-65cf263531a7", "element": "a41e2061-65cf-4c6e-9ea3-48d00d74133d",
"path": "[\"3bcfeab1-e4d4-4f63-8f60-8fc5fc551a64\", \"6c6a774e-88c3-40c5-9913-d7ec2a3d5125\"]", "path": "[\"12e84ea0-004a-43e7-9fcc-85021e2407a9\", \"a0373c38-907d-4127-9762-5aada56b7165\"]",
"ordering": 1 "ordering": 1
} }
}, },
{ {
"model": "documents.elementpath", "model": "documents.elementpath",
"pk": "56655c48-69b4-4ea0-a724-b10d1a47e231", "pk": "4450a6b1-88fb-4d11-9c7a-edd03872050d",
"fields": { "fields": {
"element": "b8c4d1e3-aa9d-425a-b70f-c8ff16ae147c", "element": "7f80cd7d-f24f-4691-a139-0ce744ea7577",
"path": "[\"7a007e29-b509-4c4e-8321-78464df6f03a\"]", "path": "[\"12e84ea0-004a-43e7-9fcc-85021e2407a9\", \"492ea0b0-bcaf-4a46-a15a-29cd08e32d90\"]",
"ordering": 2 "ordering": 0
} }
}, },
{ {
"model": "documents.elementpath", "model": "documents.elementpath",
"pk": "5c064e36-d3b5-4a8b-8f2d-97da74e84a70", "pk": "48d847e6-26be-45e8-92a4-0a6517227172",
"fields": { "fields": {
"element": "86f68e65-f23b-4d01-a9ca-c40eed9cda32", "element": "8727b32e-6b08-44fd-84ff-54d505fb5a85",
"path": "[\"3bcfeab1-e4d4-4f63-8f60-8fc5fc551a64\"]", "path": "[\"12e84ea0-004a-43e7-9fcc-85021e2407a9\", \"a0373c38-907d-4127-9762-5aada56b7165\"]",
"ordering": 6 "ordering": 0
} }
}, },
{ {
"model": "documents.elementpath", "model": "documents.elementpath",
"pk": "617f3ea6-17f8-4514-9f87-4c8bdd747e3f", "pk": "5bb0b100-e35c-4433-884e-16b3c827dea1",
"fields": { "fields": {
"element": "4d2f59fe-9808-44b1-b3b5-017490ae4064", "element": "e2e0ab90-85c8-457e-920d-479bebb43bf9",
"path": "[\"3bcfeab1-e4d4-4f63-8f60-8fc5fc551a64\"]", "path": "[\"12e84ea0-004a-43e7-9fcc-85021e2407a9\", \"67482d70-765b-4092-b462-2d955fd8a7df\"]",
"ordering": 2 "ordering": 3
} }
}, },
{ {
"model": "documents.elementpath", "model": "documents.elementpath",
"pk": "6cc0a005-dbff-4b53-b452-b6d4d8ec8eb3", "pk": "60fccadc-2668-45f0-af63-8541f9d8000a",
"fields": { "fields": {
"element": "09ee64d6-3d8d-4d74-a1cd-ec34c8c2cd38", "element": "900dcb10-2146-4571-8735-f508eb5f9986",
"path": "[\"3bcfeab1-e4d4-4f63-8f60-8fc5fc551a64\", \"664f19d6-472d-49cc-bd87-26c19db7d2d3\"]", "path": "[]",
"ordering": 0 "ordering": 0
} }
}, },
{ {
"model": "documents.elementpath", "model": "documents.elementpath",
"pk": "8adb5d49-8651-4239-b98d-425a70ff39cf", "pk": "6b954042-1718-4794-aad4-55c6e2e9e054",
"fields": { "fields": {
"element": "6a41ddf7-41e4-40ad-8234-d773b74058bc", "element": "7cd8a970-ca3a-479f-b49e-1292b216c1b9",
"path": "[\"3bcfeab1-e4d4-4f63-8f60-8fc5fc551a64\"]", "path": "[\"12e84ea0-004a-43e7-9fcc-85021e2407a9\", \"492ea0b0-bcaf-4a46-a15a-29cd08e32d90\"]",
"ordering": 1 "ordering": 2
} }
}, },
{ {
"model": "documents.elementpath", "model": "documents.elementpath",
"pk": "a2d6b2bd-677e-4f72-9a9d-64957b854a90", "pk": "6ff93429-322f-486a-bc0f-31f7047ce341",
"fields": { "fields": {
"element": "18ada82e-36c6-47e4-bcff-bee5aa63889b", "element": "c80311e3-4529-45d6-9575-31b362c99925",
"path": "[\"3bcfeab1-e4d4-4f63-8f60-8fc5fc551a64\", \"4d2f59fe-9808-44b1-b3b5-017490ae4064\"]", "path": "[\"12e84ea0-004a-43e7-9fcc-85021e2407a9\", \"737db4ff-8119-4e12-be99-968d7fa3be22\"]",
"ordering": 2 "ordering": 2
} }
}, },
{ {
"model": "documents.elementpath", "model": "documents.elementpath",
"pk": "a3d290d2-c6a1-4c80-8baf-37d42497e61e", "pk": "8fd6c9e9-3133-4733-b58b-8a093e49288c",
"fields": { "fields": {
"element": "d227268a-2c2e-40ff-b22c-ab6e52eb5bba", "element": "f6b8eced-ee41-42d3-812a-a622f1879809",
"path": "[\"3bcfeab1-e4d4-4f63-8f60-8fc5fc551a64\"]", "path": "[\"12e84ea0-004a-43e7-9fcc-85021e2407a9\", \"8144a0f8-f75b-43fa-ac27-d49d69bc483c\"]",
"ordering": 3 "ordering": 0
} }
}, },
{ {
"model": "documents.elementpath", "model": "documents.elementpath",
"pk": "a735c855-bd4b-4ece-8345-eac1dc791ff9", "pk": "98f8328f-77b3-490d-aa4c-97d6f2030e3f",
"fields": { "fields": {
"element": "ba888ed5-8c85-4f49-8f87-499219187ade", "element": "dc79378e-1804-45c8-b23f-a2eeb33734de",
"path": "[\"3bcfeab1-e4d4-4f63-8f60-8fc5fc551a64\"]", "path": "[\"12e84ea0-004a-43e7-9fcc-85021e2407a9\", \"8349d4ba-fd23-4da6-a99b-76ba2e359b6f\"]",
"ordering": 5 "ordering": 0
} }
}, },
{ {
"model": "documents.elementpath", "model": "documents.elementpath",
"pk": "a8012a46-1e99-40a4-ad86-d2b2040eb026", "pk": "9979cf91-e6da-46e4-976e-386cb9ebbc42",
"fields": { "fields": {
"element": "4c054d5e-f30c-4f70-a368-8e6f78f48ba1", "element": "7ac6504c-4088-4e6e-9a48-567f1f7e54c8",
"path": "[\"3bcfeab1-e4d4-4f63-8f60-8fc5fc551a64\", \"d227268a-2c2e-40ff-b22c-ab6e52eb5bba\"]", "path": "[\"900dcb10-2146-4571-8735-f508eb5f9986\"]",
"ordering": 0 "ordering": 1
} }
}, },
{ {
"model": "documents.elementpath", "model": "documents.elementpath",
"pk": "a8b4a820-4de5-4164-88e9-66b3fd875938", "pk": "99ac36ba-7c91-4beb-a10b-97d8edffa1d9",
"fields": { "fields": {
"element": "34cdee1d-40e3-4499-b04b-93f6d2bfb802", "element": "12e84ea0-004a-43e7-9fcc-85021e2407a9",
"path": "[\"3bcfeab1-e4d4-4f63-8f60-8fc5fc551a64\", \"6c6a774e-88c3-40c5-9913-d7ec2a3d5125\"]", "path": "[]",
"ordering": 2 "ordering": 0
} }
}, },
{ {
"model": "documents.elementpath", "model": "documents.elementpath",
"pk": "ab00de7e-015c-4f76-a3c0-645cb879a024", "pk": "9feb4874-46bf-463a-9bc9-71b13af8bcc0",
"fields": { "fields": {
"element": "2c0f28b1-b8e9-4f08-9014-75ce7950ee6f", "element": "e38ab791-092f-48eb-bb09-ea95e5a01998",
"path": "[\"3bcfeab1-e4d4-4f63-8f60-8fc5fc551a64\", \"6a41ddf7-41e4-40ad-8234-d773b74058bc\"]", "path": "[\"12e84ea0-004a-43e7-9fcc-85021e2407a9\", \"492ea0b0-bcaf-4a46-a15a-29cd08e32d90\"]",
"ordering": 1 "ordering": 1
} }
}, },
{ {
"model": "documents.elementpath", "model": "documents.elementpath",
"pk": "b100fd6e-d7ed-4481-8604-f07e9d554637", "pk": "b447f917-b73c-42b5-9512-1a3af17b3eee",
"fields": { "fields": {
"element": "3603393d-4831-4dbf-9672-3fbe1077e03a", "element": "a0373c38-907d-4127-9762-5aada56b7165",
"path": "[\"3bcfeab1-e4d4-4f63-8f60-8fc5fc551a64\", \"4d2f59fe-9808-44b1-b3b5-017490ae4064\"]", "path": "[\"12e84ea0-004a-43e7-9fcc-85021e2407a9\"]",
"ordering": 1 "ordering": 4
} }
}, },
{ {
"model": "documents.elementpath", "model": "documents.elementpath",
"pk": "b7098cdc-dcba-4efc-8213-e92af55fa6f9", "pk": "b869ccff-bb9b-4c85-9743-d8930f2d920a",
"fields": { "fields": {
"element": "3f3bb3ee-ec7c-436c-9dde-f8aa0e1a69d7", "element": "f8d56f23-51f6-40dd-9482-939a1dd877b3",
"path": "[\"3bcfeab1-e4d4-4f63-8f60-8fc5fc551a64\"]", "path": "[\"12e84ea0-004a-43e7-9fcc-85021e2407a9\"]",
"ordering": 7 "ordering": 7
} }
}, },
{ {
"model": "documents.elementpath", "model": "documents.elementpath",
"pk": "b992817b-343e-4a5b-bf6d-42cb334696d1", "pk": "b8a8076c-62d4-4f86-a2f0-21187d589279",
"fields": { "fields": {
"element": "b0a0984b-dcf2-46da-8d6e-933020a46011", "element": "8144a0f8-f75b-43fa-ac27-d49d69bc483c",
"path": "[\"3bcfeab1-e4d4-4f63-8f60-8fc5fc551a64\", \"6a41ddf7-41e4-40ad-8234-d773b74058bc\"]", "path": "[\"12e84ea0-004a-43e7-9fcc-85021e2407a9\"]",
"ordering": 2 "ordering": 6
} }
}, },
{ {
"model": "documents.elementpath", "model": "documents.elementpath",
"pk": "c35f1e16-f92d-4589-afc4-6c3115fa36d7", "pk": "be089329-1d86-42cb-85b6-3a2520a334ed",
"fields": { "fields": {
"element": "9fd626f8-a5eb-4ae3-9f4f-f0ea4216712e", "element": "492ea0b0-bcaf-4a46-a15a-29cd08e32d90",
"path": "[\"3bcfeab1-e4d4-4f63-8f60-8fc5fc551a64\", \"664f19d6-472d-49cc-bd87-26c19db7d2d3\"]", "path": "[\"12e84ea0-004a-43e7-9fcc-85021e2407a9\"]",
"ordering": 1 "ordering": 1
} }
}, },
{ {
"model": "documents.elementpath", "model": "documents.elementpath",
"pk": "d0586c21-e60a-41d8-9a17-b71eeb75bc68", "pk": "c66e5e45-f39b-42b7-bbf7-55bab78bfe2c",
"fields": { "fields": {
"element": "e2f8eee0-cf55-404c-86e6-6950ab88faac", "element": "72dd24ed-22f5-40a6-bbb4-b4b0abfcd758",
"path": "[\"3bcfeab1-e4d4-4f63-8f60-8fc5fc551a64\", \"3f3bb3ee-ec7c-436c-9dde-f8aa0e1a69d7\"]", "path": "[\"12e84ea0-004a-43e7-9fcc-85021e2407a9\", \"f8d56f23-51f6-40dd-9482-939a1dd877b3\"]",
"ordering": 0 "ordering": 0
} }
}, },
{ {
"model": "documents.elementpath", "model": "documents.elementpath",
"pk": "da4fe1fb-7ad7-4b38-973f-c9a4ca8d402f", "pk": "cc4ca9d4-57ac-4b86-aa08-848fb31c15f1",
"fields": {
"element": "43ba23ed-3e59-466d-b48f-35928d3d9a59",
"path": "[\"12e84ea0-004a-43e7-9fcc-85021e2407a9\"]",
"ordering": 3
}
},
{
"model": "documents.elementpath",
"pk": "d28feecf-d0a3-4bd6-b045-71cae47ccf4f",
"fields": { "fields": {
"element": "3189dc31-fa75-4c60-b1d0-7a15720e35ca", "element": "67482d70-765b-4092-b462-2d955fd8a7df",
"path": "[\"3bcfeab1-e4d4-4f63-8f60-8fc5fc551a64\", \"86f68e65-f23b-4d01-a9ca-c40eed9cda32\"]", "path": "[\"12e84ea0-004a-43e7-9fcc-85021e2407a9\"]",
"ordering": 0 "ordering": 0
} }
}, },
{ {
"model": "documents.elementpath", "model": "documents.elementpath",
"pk": "e2c73d2f-8881-4b4e-909f-7244abd4c92c", "pk": "d840ea1c-695a-4e81-bfb1-ccc2c7746979",
"fields": { "fields": {
"element": "664f19d6-472d-49cc-bd87-26c19db7d2d3", "element": "f09bebdb-152e-427c-ae2b-2e296982f342",
"path": "[\"3bcfeab1-e4d4-4f63-8f60-8fc5fc551a64\"]", "path": "[\"900dcb10-2146-4571-8735-f508eb5f9986\"]",
"ordering": 4 "ordering": 2
} }
}, },
{ {
"model": "documents.elementpath", "model": "documents.elementpath",
"pk": "e6c19e34-49a7-4dc2-aa37-8d96f2a7b43e", "pk": "dd98d35b-a3dd-48fa-bec0-1e932f9314ff",
"fields": { "fields": {
"element": "7a007e29-b509-4c4e-8321-78464df6f03a", "element": "2aaa4788-127e-464c-bd8c-cd938796d207",
"path": "[]", "path": "[\"900dcb10-2146-4571-8735-f508eb5f9986\"]",
"ordering": 0 "ordering": 0
} }
}, },
{ {
"model": "documents.elementpath", "model": "documents.elementpath",
"pk": "e9d64de1-c0c6-44a1-bb33-38c87a144282", "pk": "de39b960-87d6-4805-bd39-93debf36f7b3",
"fields": { "fields": {
"element": "d5daac1b-5f57-4d3c-b120-54adbcc82d7d", "element": "ba400ee3-7247-4c20-bef4-3a49ad9e2e77",
"path": "[\"3bcfeab1-e4d4-4f63-8f60-8fc5fc551a64\", \"ba888ed5-8c85-4f49-8f87-499219187ade\"]", "path": "[\"12e84ea0-004a-43e7-9fcc-85021e2407a9\", \"67482d70-765b-4092-b462-2d955fd8a7df\"]",
"ordering": 0 "ordering": 0
} }
}, },
{ {
"model": "documents.elementpath", "model": "documents.elementpath",
"pk": "ed3283f8-0af1-467e-8a52-77f9d434af78", "pk": "f0042f9c-66a9-448d-a202-03b55d40d03d",
"fields": { "fields": {
"element": "92101c2b-885f-42e2-a0cb-13a8a04c0ea8", "element": "9f1c4e10-d94c-4628-a575-5cb0afdd34af",
"path": "[\"3bcfeab1-e4d4-4f63-8f60-8fc5fc551a64\", \"6a41ddf7-41e4-40ad-8234-d773b74058bc\"]", "path": "[\"12e84ea0-004a-43e7-9fcc-85021e2407a9\", \"43ba23ed-3e59-466d-b48f-35928d3d9a59\"]",
"ordering": 0 "ordering": 0
} }
}, },
{ {
"model": "documents.element", "model": "documents.element",
"pk": "09ee64d6-3d8d-4d74-a1cd-ec34c8c2cd38", "pk": "12e84ea0-004a-43e7-9fcc-85021e2407a9",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "bc871e02-a23f-4799-a4d7-bb81813f41f5", "type": "60e8c1f1-c04d-49b6-bc6e-70e38e437f36",
"name": "Surface B", "name": "Volume 1",
"creator": null, "creator": null,
"worker_version": null, "worker_version": null,
"worker_run": null, "worker_run": null,
"image": "d3547a48-79f6-4c1f-8f16-c0be1a1da9fc", "image": null,
"polygon": "LINEARRING (600 600, 600 1000, 1000 1000, 1000 600, 600 600)", "polygon": null,
"rotation_angle": 0, "rotation_angle": 0,
"mirrored": false, "mirrored": false,
"confidence": null "confidence": null
...@@ -828,18 +828,18 @@ ...@@ -828,18 +828,18 @@
}, },
{ {
"model": "documents.element", "model": "documents.element",
"pk": "17a65610-023b-46c7-93a6-453335626d17", "pk": "1f20a3a4-33be-43a3-9427-393799aba6d7",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "634e6aee-87a1-4845-a63e-83e7226aa557", "type": "aa7b5e5a-eaa3-49b5-8c7a-826941c9d472",
"name": "Text line", "name": "PARIS",
"creator": null, "creator": null,
"worker_version": null, "worker_version": null,
"worker_run": null, "worker_run": null,
"image": "d3547a48-79f6-4c1f-8f16-c0be1a1da9fc", "image": "68df44c1-ed1f-4f29-870d-de7b4b03b1a5",
"polygon": "LINEARRING (400 400, 400 500, 500 500, 500 400, 400 400)", "polygon": "LINEARRING (100 100, 100 200, 200 200, 200 100, 100 100)",
"rotation_angle": 0, "rotation_angle": 0,
"mirrored": false, "mirrored": false,
"confidence": null "confidence": null
...@@ -847,18 +847,18 @@ ...@@ -847,18 +847,18 @@
}, },
{ {
"model": "documents.element", "model": "documents.element",
"pk": "18ada82e-36c6-47e4-bcff-bee5aa63889b", "pk": "2aaa4788-127e-464c-bd8c-cd938796d207",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "3bbbd33a-b906-4526-9e0b-0643ade1b080", "type": "f2d75650-9d48-4b6e-b210-dbd595a668d2",
"name": "DATUM", "name": "Volume 2, page 1r",
"creator": null, "creator": null,
"worker_version": null, "worker_version": null,
"worker_run": null, "worker_run": null,
"image": "d4db6162-7d7b-4839-a84f-756e74fef150", "image": "a68c21d7-d24f-44d7-b134-3c50ee6ddba1",
"polygon": "LINEARRING (700 700, 700 800, 800 800, 800 700, 700 700)", "polygon": "LINEARRING (0 0, 0 1000, 1000 1000, 1000 0, 0 0)",
"rotation_angle": 0, "rotation_angle": 0,
"mirrored": false, "mirrored": false,
"confidence": null "confidence": null
...@@ -866,18 +866,18 @@ ...@@ -866,18 +866,18 @@
}, },
{ {
"model": "documents.element", "model": "documents.element",
"pk": "2c0f28b1-b8e9-4f08-9014-75ce7950ee6f", "pk": "43ba23ed-3e59-466d-b48f-35928d3d9a59",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "3bbbd33a-b906-4526-9e0b-0643ade1b080", "type": "c6267733-b1ce-4ea3-ac20-3a18c3d66f24",
"name": "ROY", "name": "Act 1",
"creator": null, "creator": null,
"worker_version": null, "worker_version": null,
"worker_run": null, "worker_run": null,
"image": "47f164d3-d26f-41e8-9df1-b538645d60b5", "image": null,
"polygon": "LINEARRING (400 400, 400 500, 500 500, 500 400, 400 400)", "polygon": null,
"rotation_angle": 0, "rotation_angle": 0,
"mirrored": false, "mirrored": false,
"confidence": null "confidence": null
...@@ -885,18 +885,18 @@ ...@@ -885,18 +885,18 @@
}, },
{ {
"model": "documents.element", "model": "documents.element",
"pk": "3189dc31-fa75-4c60-b1d0-7a15720e35ca", "pk": "492ea0b0-bcaf-4a46-a15a-29cd08e32d90",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "bc871e02-a23f-4799-a4d7-bb81813f41f5", "type": "f2d75650-9d48-4b6e-b210-dbd595a668d2",
"name": "Surface E", "name": "Volume 1, page 1v",
"creator": null, "creator": null,
"worker_version": null, "worker_version": null,
"worker_run": null, "worker_run": null,
"image": "d4db6162-7d7b-4839-a84f-756e74fef150", "image": "7f006318-b3d2-4cda-b1ab-8ff844c07b35",
"polygon": "LINEARRING (300 300, 300 600, 600 600, 600 300, 300 300)", "polygon": "LINEARRING (0 0, 0 1000, 1000 1000, 1000 0, 0 0)",
"rotation_angle": 0, "rotation_angle": 0,
"mirrored": false, "mirrored": false,
"confidence": null "confidence": null
...@@ -904,17 +904,17 @@ ...@@ -904,17 +904,17 @@
}, },
{ {
"model": "documents.element", "model": "documents.element",
"pk": "34cdee1d-40e3-4499-b04b-93f6d2bfb802", "pk": "60a6c062-1bbb-4e5f-82e7-37cb77d92419",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "3bbbd33a-b906-4526-9e0b-0643ade1b080", "type": "aa7b5e5a-eaa3-49b5-8c7a-826941c9d472",
"name": "DATUM", "name": "DATUM",
"creator": null, "creator": null,
"worker_version": null, "worker_version": null,
"worker_run": null, "worker_run": null,
"image": "d3547a48-79f6-4c1f-8f16-c0be1a1da9fc", "image": "627a53a6-466c-4114-b826-852ecd328e47",
"polygon": "LINEARRING (700 700, 700 800, 800 800, 800 700, 700 700)", "polygon": "LINEARRING (700 700, 700 800, 800 800, 800 700, 700 700)",
"rotation_angle": 0, "rotation_angle": 0,
"mirrored": false, "mirrored": false,
...@@ -923,17 +923,17 @@ ...@@ -923,17 +923,17 @@
}, },
{ {
"model": "documents.element", "model": "documents.element",
"pk": "3603393d-4831-4dbf-9672-3fbe1077e03a", "pk": "6452b6c6-3d58-48c2-9032-691095fe8317",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "3bbbd33a-b906-4526-9e0b-0643ade1b080", "type": "aa7b5e5a-eaa3-49b5-8c7a-826941c9d472",
"name": "ROY", "name": "ROY",
"creator": null, "creator": null,
"worker_version": null, "worker_version": null,
"worker_run": null, "worker_run": null,
"image": "d4db6162-7d7b-4839-a84f-756e74fef150", "image": "627a53a6-466c-4114-b826-852ecd328e47",
"polygon": "LINEARRING (400 400, 400 500, 500 500, 500 400, 400 400)", "polygon": "LINEARRING (400 400, 400 500, 500 500, 500 400, 400 400)",
"rotation_angle": 0, "rotation_angle": 0,
"mirrored": false, "mirrored": false,
...@@ -942,18 +942,18 @@ ...@@ -942,18 +942,18 @@
}, },
{ {
"model": "documents.element", "model": "documents.element",
"pk": "3bcfeab1-e4d4-4f63-8f60-8fc5fc551a64", "pk": "66843ee4-559b-4d2d-a9ce-4dd425022159",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "4200ad41-d032-476a-acb4-943e6481ee6d", "type": "aa7b5e5a-eaa3-49b5-8c7a-826941c9d472",
"name": "Volume 1", "name": "ROY",
"creator": null, "creator": null,
"worker_version": null, "worker_version": null,
"worker_run": null, "worker_run": null,
"image": null, "image": "68df44c1-ed1f-4f29-870d-de7b4b03b1a5",
"polygon": null, "polygon": "LINEARRING (400 400, 400 500, 500 500, 500 400, 400 400)",
"rotation_angle": 0, "rotation_angle": 0,
"mirrored": false, "mirrored": false,
"confidence": null "confidence": null
...@@ -961,18 +961,18 @@ ...@@ -961,18 +961,18 @@
}, },
{ {
"model": "documents.element", "model": "documents.element",
"pk": "3f3bb3ee-ec7c-436c-9dde-f8aa0e1a69d7", "pk": "67482d70-765b-4092-b462-2d955fd8a7df",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "eda3da9f-1a6b-4f7a-91d1-f28e4e74f76a", "type": "f2d75650-9d48-4b6e-b210-dbd595a668d2",
"name": "Act 5", "name": "Volume 1, page 1r",
"creator": null, "creator": null,
"worker_version": null, "worker_version": null,
"worker_run": null, "worker_run": null,
"image": null, "image": "627a53a6-466c-4114-b826-852ecd328e47",
"polygon": null, "polygon": "LINEARRING (0 0, 0 1000, 1000 1000, 1000 0, 0 0)",
"rotation_angle": 0, "rotation_angle": 0,
"mirrored": false, "mirrored": false,
"confidence": null "confidence": null
...@@ -980,18 +980,18 @@ ...@@ -980,18 +980,18 @@
}, },
{ {
"model": "documents.element", "model": "documents.element",
"pk": "469f4606-f5ea-406d-a0bd-6d48050c39ed", "pk": "72dd24ed-22f5-40a6-bbb4-b4b0abfcd758",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "3bbbd33a-b906-4526-9e0b-0643ade1b080", "type": "fb9cf6d3-b31a-449c-a780-2f5db501695f",
"name": "PARIS", "name": "Surface F",
"creator": null, "creator": null,
"worker_version": null, "worker_version": null,
"worker_run": null, "worker_run": null,
"image": "d4db6162-7d7b-4839-a84f-756e74fef150", "image": "68df44c1-ed1f-4f29-870d-de7b4b03b1a5",
"polygon": "LINEARRING (100 100, 100 200, 200 200, 200 100, 100 100)", "polygon": "LINEARRING (600 600, 600 1000, 1000 1000, 1000 600, 600 600)",
"rotation_angle": 0, "rotation_angle": 0,
"mirrored": false, "mirrored": false,
"confidence": null "confidence": null
...@@ -999,18 +999,18 @@ ...@@ -999,18 +999,18 @@
}, },
{ {
"model": "documents.element", "model": "documents.element",
"pk": "4c054d5e-f30c-4f70-a368-8e6f78f48ba1", "pk": "737db4ff-8119-4e12-be99-968d7fa3be22",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "bc871e02-a23f-4799-a4d7-bb81813f41f5", "type": "f2d75650-9d48-4b6e-b210-dbd595a668d2",
"name": "Surface A", "name": "Volume 1, page 2r",
"creator": null, "creator": null,
"worker_version": null, "worker_version": null,
"worker_run": null, "worker_run": null,
"image": "d3547a48-79f6-4c1f-8f16-c0be1a1da9fc", "image": "68df44c1-ed1f-4f29-870d-de7b4b03b1a5",
"polygon": "LINEARRING (0 0, 0 600, 600 600, 600 0, 0 0)", "polygon": "LINEARRING (0 0, 0 1000, 1000 1000, 1000 0, 0 0)",
"rotation_angle": 0, "rotation_angle": 0,
"mirrored": false, "mirrored": false,
"confidence": null "confidence": null
...@@ -1018,17 +1018,17 @@ ...@@ -1018,17 +1018,17 @@
}, },
{ {
"model": "documents.element", "model": "documents.element",
"pk": "4d2f59fe-9808-44b1-b3b5-017490ae4064", "pk": "7ac6504c-4088-4e6e-9a48-567f1f7e54c8",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "7afe34f9-ad57-4ce7-872a-4d9aa31b6d0b", "type": "f2d75650-9d48-4b6e-b210-dbd595a668d2",
"name": "Volume 1, page 2r", "name": "Volume 2, page 1v",
"creator": null, "creator": null,
"worker_version": null, "worker_version": null,
"worker_run": null, "worker_run": null,
"image": "d4db6162-7d7b-4839-a84f-756e74fef150", "image": "4867c2a1-fadc-4086-842c-c914b678d37d",
"polygon": "LINEARRING (0 0, 0 1000, 1000 1000, 1000 0, 0 0)", "polygon": "LINEARRING (0 0, 0 1000, 1000 1000, 1000 0, 0 0)",
"rotation_angle": 0, "rotation_angle": 0,
"mirrored": false, "mirrored": false,
...@@ -1037,18 +1037,18 @@ ...@@ -1037,18 +1037,18 @@
}, },
{ {
"model": "documents.element", "model": "documents.element",
"pk": "60313262-3273-4c39-a8ee-cedc733f6990", "pk": "7cd8a970-ca3a-479f-b49e-1292b216c1b9",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "7afe34f9-ad57-4ce7-872a-4d9aa31b6d0b", "type": "aa7b5e5a-eaa3-49b5-8c7a-826941c9d472",
"name": "Volume 2, page 1r", "name": "DATUM",
"creator": null, "creator": null,
"worker_version": null, "worker_version": null,
"worker_run": null, "worker_run": null,
"image": "2552f45d-6880-4a4c-b9c2-1091598a52b4", "image": "7f006318-b3d2-4cda-b1ab-8ff844c07b35",
"polygon": "LINEARRING (0 0, 0 1000, 1000 1000, 1000 0, 0 0)", "polygon": "LINEARRING (700 700, 700 800, 800 800, 800 700, 700 700)",
"rotation_angle": 0, "rotation_angle": 0,
"mirrored": false, "mirrored": false,
"confidence": null "confidence": null
...@@ -1056,13 +1056,32 @@ ...@@ -1056,13 +1056,32 @@
}, },
{ {
"model": "documents.element", "model": "documents.element",
"pk": "664f19d6-472d-49cc-bd87-26c19db7d2d3", "pk": "7f80cd7d-f24f-4691-a139-0ce744ea7577",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "eda3da9f-1a6b-4f7a-91d1-f28e4e74f76a", "type": "aa7b5e5a-eaa3-49b5-8c7a-826941c9d472",
"name": "Act 2", "name": "PARIS",
"creator": null,
"worker_version": null,
"worker_run": null,
"image": "7f006318-b3d2-4cda-b1ab-8ff844c07b35",
"polygon": "LINEARRING (100 100, 100 200, 200 200, 200 100, 100 100)",
"rotation_angle": 0,
"mirrored": false,
"confidence": null
}
},
{
"model": "documents.element",
"pk": "8144a0f8-f75b-43fa-ac27-d49d69bc483c",
"fields": {
"created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z",
"corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "c6267733-b1ce-4ea3-ac20-3a18c3d66f24",
"name": "Act 4",
"creator": null, "creator": null,
"worker_version": null, "worker_version": null,
"worker_run": null, "worker_run": null,
...@@ -1075,18 +1094,18 @@ ...@@ -1075,18 +1094,18 @@
}, },
{ {
"model": "documents.element", "model": "documents.element",
"pk": "6a41ddf7-41e4-40ad-8234-d773b74058bc", "pk": "8349d4ba-fd23-4da6-a99b-76ba2e359b6f",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "7afe34f9-ad57-4ce7-872a-4d9aa31b6d0b", "type": "c6267733-b1ce-4ea3-ac20-3a18c3d66f24",
"name": "Volume 1, page 1v", "name": "Act 3",
"creator": null, "creator": null,
"worker_version": null, "worker_version": null,
"worker_run": null, "worker_run": null,
"image": "47f164d3-d26f-41e8-9df1-b538645d60b5", "image": null,
"polygon": "LINEARRING (0 0, 0 1000, 1000 1000, 1000 0, 0 0)", "polygon": null,
"rotation_angle": 0, "rotation_angle": 0,
"mirrored": false, "mirrored": false,
"confidence": null "confidence": null
...@@ -1094,18 +1113,18 @@ ...@@ -1094,18 +1113,18 @@
}, },
{ {
"model": "documents.element", "model": "documents.element",
"pk": "6c6a774e-88c3-40c5-9913-d7ec2a3d5125", "pk": "8727b32e-6b08-44fd-84ff-54d505fb5a85",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "7afe34f9-ad57-4ce7-872a-4d9aa31b6d0b", "type": "fb9cf6d3-b31a-449c-a780-2f5db501695f",
"name": "Volume 1, page 1r", "name": "Surface B",
"creator": null, "creator": null,
"worker_version": null, "worker_version": null,
"worker_run": null, "worker_run": null,
"image": "d3547a48-79f6-4c1f-8f16-c0be1a1da9fc", "image": "627a53a6-466c-4114-b826-852ecd328e47",
"polygon": "LINEARRING (0 0, 0 1000, 1000 1000, 1000 0, 0 0)", "polygon": "LINEARRING (600 600, 600 1000, 1000 1000, 1000 600, 600 600)",
"rotation_angle": 0, "rotation_angle": 0,
"mirrored": false, "mirrored": false,
"confidence": null "confidence": null
...@@ -1113,12 +1132,12 @@ ...@@ -1113,12 +1132,12 @@
}, },
{ {
"model": "documents.element", "model": "documents.element",
"pk": "7a007e29-b509-4c4e-8321-78464df6f03a", "pk": "900dcb10-2146-4571-8735-f508eb5f9986",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "4200ad41-d032-476a-acb4-943e6481ee6d", "type": "60e8c1f1-c04d-49b6-bc6e-70e38e437f36",
"name": "Volume 2", "name": "Volume 2",
"creator": null, "creator": null,
"worker_version": null, "worker_version": null,
...@@ -1132,18 +1151,18 @@ ...@@ -1132,18 +1151,18 @@
}, },
{ {
"model": "documents.element", "model": "documents.element",
"pk": "86f68e65-f23b-4d01-a9ca-c40eed9cda32", "pk": "9f1c4e10-d94c-4628-a575-5cb0afdd34af",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "eda3da9f-1a6b-4f7a-91d1-f28e4e74f76a", "type": "fb9cf6d3-b31a-449c-a780-2f5db501695f",
"name": "Act 4", "name": "Surface A",
"creator": null, "creator": null,
"worker_version": null, "worker_version": null,
"worker_run": null, "worker_run": null,
"image": null, "image": "627a53a6-466c-4114-b826-852ecd328e47",
"polygon": null, "polygon": "LINEARRING (0 0, 0 600, 600 600, 600 0, 0 0)",
"rotation_angle": 0, "rotation_angle": 0,
"mirrored": false, "mirrored": false,
"confidence": null "confidence": null
...@@ -1151,18 +1170,18 @@ ...@@ -1151,18 +1170,18 @@
}, },
{ {
"model": "documents.element", "model": "documents.element",
"pk": "92101c2b-885f-42e2-a0cb-13a8a04c0ea8", "pk": "a0373c38-907d-4127-9762-5aada56b7165",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "3bbbd33a-b906-4526-9e0b-0643ade1b080", "type": "c6267733-b1ce-4ea3-ac20-3a18c3d66f24",
"name": "PARIS", "name": "Act 2",
"creator": null, "creator": null,
"worker_version": null, "worker_version": null,
"worker_run": null, "worker_run": null,
"image": "47f164d3-d26f-41e8-9df1-b538645d60b5", "image": null,
"polygon": "LINEARRING (100 100, 100 200, 200 200, 200 100, 100 100)", "polygon": null,
"rotation_angle": 0, "rotation_angle": 0,
"mirrored": false, "mirrored": false,
"confidence": null "confidence": null
...@@ -1170,17 +1189,17 @@ ...@@ -1170,17 +1189,17 @@
}, },
{ {
"model": "documents.element", "model": "documents.element",
"pk": "9fd626f8-a5eb-4ae3-9f4f-f0ea4216712e", "pk": "a41e2061-65cf-4c6e-9ea3-48d00d74133d",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "bc871e02-a23f-4799-a4d7-bb81813f41f5", "type": "fb9cf6d3-b31a-449c-a780-2f5db501695f",
"name": "Surface C", "name": "Surface C",
"creator": null, "creator": null,
"worker_version": null, "worker_version": null,
"worker_run": null, "worker_run": null,
"image": "47f164d3-d26f-41e8-9df1-b538645d60b5", "image": "7f006318-b3d2-4cda-b1ab-8ff844c07b35",
"polygon": "LINEARRING (0 0, 0 1000, 1000 1000, 1000 0, 0 0)", "polygon": "LINEARRING (0 0, 0 1000, 1000 1000, 1000 0, 0 0)",
"rotation_angle": 0, "rotation_angle": 0,
"mirrored": false, "mirrored": false,
...@@ -1189,18 +1208,18 @@ ...@@ -1189,18 +1208,18 @@
}, },
{ {
"model": "documents.element", "model": "documents.element",
"pk": "a8c108a2-a6b7-4401-9d64-65cf263531a7", "pk": "ba400ee3-7247-4c20-bef4-3a49ad9e2e77",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "3bbbd33a-b906-4526-9e0b-0643ade1b080", "type": "aa7b5e5a-eaa3-49b5-8c7a-826941c9d472",
"name": "ROY", "name": "PARIS",
"creator": null, "creator": null,
"worker_version": null, "worker_version": null,
"worker_run": null, "worker_run": null,
"image": "d3547a48-79f6-4c1f-8f16-c0be1a1da9fc", "image": "627a53a6-466c-4114-b826-852ecd328e47",
"polygon": "LINEARRING (400 400, 400 500, 500 500, 500 400, 400 400)", "polygon": "LINEARRING (100 100, 100 200, 200 200, 200 100, 100 100)",
"rotation_angle": 0, "rotation_angle": 0,
"mirrored": false, "mirrored": false,
"confidence": null "confidence": null
...@@ -1208,17 +1227,17 @@ ...@@ -1208,17 +1227,17 @@
}, },
{ {
"model": "documents.element", "model": "documents.element",
"pk": "b0a0984b-dcf2-46da-8d6e-933020a46011", "pk": "c80311e3-4529-45d6-9575-31b362c99925",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "3bbbd33a-b906-4526-9e0b-0643ade1b080", "type": "aa7b5e5a-eaa3-49b5-8c7a-826941c9d472",
"name": "DATUM", "name": "DATUM",
"creator": null, "creator": null,
"worker_version": null, "worker_version": null,
"worker_run": null, "worker_run": null,
"image": "47f164d3-d26f-41e8-9df1-b538645d60b5", "image": "68df44c1-ed1f-4f29-870d-de7b4b03b1a5",
"polygon": "LINEARRING (700 700, 700 800, 800 800, 800 700, 700 700)", "polygon": "LINEARRING (700 700, 700 800, 800 800, 800 700, 700 700)",
"rotation_angle": 0, "rotation_angle": 0,
"mirrored": false, "mirrored": false,
...@@ -1227,18 +1246,18 @@ ...@@ -1227,18 +1246,18 @@
}, },
{ {
"model": "documents.element", "model": "documents.element",
"pk": "b8c4d1e3-aa9d-425a-b70f-c8ff16ae147c", "pk": "dc79378e-1804-45c8-b23f-a2eeb33734de",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "7afe34f9-ad57-4ce7-872a-4d9aa31b6d0b", "type": "fb9cf6d3-b31a-449c-a780-2f5db501695f",
"name": "Volume 2, page 2r", "name": "Surface D",
"creator": null, "creator": null,
"worker_version": null, "worker_version": null,
"worker_run": null, "worker_run": null,
"image": "4b93eabe-b42d-4b88-8f31-a63d0258000a", "image": "68df44c1-ed1f-4f29-870d-de7b4b03b1a5",
"polygon": "LINEARRING (0 0, 0 1000, 1000 1000, 1000 0, 0 0)", "polygon": "LINEARRING (0 0, 0 300, 300 300, 300 0, 0 0)",
"rotation_angle": 0, "rotation_angle": 0,
"mirrored": false, "mirrored": false,
"confidence": null "confidence": null
...@@ -1246,18 +1265,18 @@ ...@@ -1246,18 +1265,18 @@
}, },
{ {
"model": "documents.element", "model": "documents.element",
"pk": "ba888ed5-8c85-4f49-8f87-499219187ade", "pk": "e2e0ab90-85c8-457e-920d-479bebb43bf9",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "eda3da9f-1a6b-4f7a-91d1-f28e4e74f76a", "type": "097f73b9-4ea7-4063-98b0-e17eb698e77a",
"name": "Act 3", "name": "Text line",
"creator": null, "creator": null,
"worker_version": null, "worker_version": null,
"worker_run": null, "worker_run": null,
"image": null, "image": "627a53a6-466c-4114-b826-852ecd328e47",
"polygon": null, "polygon": "LINEARRING (400 400, 400 500, 500 500, 500 400, 400 400)",
"rotation_angle": 0, "rotation_angle": 0,
"mirrored": false, "mirrored": false,
"confidence": null "confidence": null
...@@ -1265,18 +1284,18 @@ ...@@ -1265,18 +1284,18 @@
}, },
{ {
"model": "documents.element", "model": "documents.element",
"pk": "c16df32e-03b5-47e4-868f-98d57eac1f15", "pk": "e38ab791-092f-48eb-bb09-ea95e5a01998",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "7afe34f9-ad57-4ce7-872a-4d9aa31b6d0b", "type": "aa7b5e5a-eaa3-49b5-8c7a-826941c9d472",
"name": "Volume 2, page 1v", "name": "ROY",
"creator": null, "creator": null,
"worker_version": null, "worker_version": null,
"worker_run": null, "worker_run": null,
"image": "5de01fda-de62-4d26-b8bf-5c3f4678de3b", "image": "7f006318-b3d2-4cda-b1ab-8ff844c07b35",
"polygon": "LINEARRING (0 0, 0 1000, 1000 1000, 1000 0, 0 0)", "polygon": "LINEARRING (400 400, 400 500, 500 500, 500 400, 400 400)",
"rotation_angle": 0, "rotation_angle": 0,
"mirrored": false, "mirrored": false,
"confidence": null "confidence": null
...@@ -1284,37 +1303,18 @@ ...@@ -1284,37 +1303,18 @@
}, },
{ {
"model": "documents.element", "model": "documents.element",
"pk": "d227268a-2c2e-40ff-b22c-ab6e52eb5bba", "pk": "f09bebdb-152e-427c-ae2b-2e296982f342",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "eda3da9f-1a6b-4f7a-91d1-f28e4e74f76a", "type": "f2d75650-9d48-4b6e-b210-dbd595a668d2",
"name": "Act 1", "name": "Volume 2, page 2r",
"creator": null,
"worker_version": null,
"worker_run": null,
"image": null,
"polygon": null,
"rotation_angle": 0,
"mirrored": false,
"confidence": null
}
},
{
"model": "documents.element",
"pk": "d3dc3f63-9894-434b-9715-7bd906b63e63",
"fields": {
"created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a",
"type": "3bbbd33a-b906-4526-9e0b-0643ade1b080",
"name": "PARIS",
"creator": null, "creator": null,
"worker_version": null, "worker_version": null,
"worker_run": null, "worker_run": null,
"image": "d3547a48-79f6-4c1f-8f16-c0be1a1da9fc", "image": "d7f4c84a-8aae-4c7d-86ce-567c5d4adc6d",
"polygon": "LINEARRING (100 100, 100 200, 200 200, 200 100, 100 100)", "polygon": "LINEARRING (0 0, 0 1000, 1000 1000, 1000 0, 0 0)",
"rotation_angle": 0, "rotation_angle": 0,
"mirrored": false, "mirrored": false,
"confidence": null "confidence": null
...@@ -1322,18 +1322,18 @@ ...@@ -1322,18 +1322,18 @@
}, },
{ {
"model": "documents.element", "model": "documents.element",
"pk": "d5daac1b-5f57-4d3c-b120-54adbcc82d7d", "pk": "f6b8eced-ee41-42d3-812a-a622f1879809",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "bc871e02-a23f-4799-a4d7-bb81813f41f5", "type": "fb9cf6d3-b31a-449c-a780-2f5db501695f",
"name": "Surface D", "name": "Surface E",
"creator": null, "creator": null,
"worker_version": null, "worker_version": null,
"worker_run": null, "worker_run": null,
"image": "d4db6162-7d7b-4839-a84f-756e74fef150", "image": "68df44c1-ed1f-4f29-870d-de7b4b03b1a5",
"polygon": "LINEARRING (0 0, 0 300, 300 300, 300 0, 0 0)", "polygon": "LINEARRING (300 300, 300 600, 600 600, 600 300, 300 300)",
"rotation_angle": 0, "rotation_angle": 0,
"mirrored": false, "mirrored": false,
"confidence": null "confidence": null
...@@ -1341,18 +1341,18 @@ ...@@ -1341,18 +1341,18 @@
}, },
{ {
"model": "documents.element", "model": "documents.element",
"pk": "e2f8eee0-cf55-404c-86e6-6950ab88faac", "pk": "f8d56f23-51f6-40dd-9482-939a1dd877b3",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "bc871e02-a23f-4799-a4d7-bb81813f41f5", "type": "c6267733-b1ce-4ea3-ac20-3a18c3d66f24",
"name": "Surface F", "name": "Act 5",
"creator": null, "creator": null,
"worker_version": null, "worker_version": null,
"worker_run": null, "worker_run": null,
"image": "d4db6162-7d7b-4839-a84f-756e74fef150", "image": null,
"polygon": "LINEARRING (600 600, 600 1000, 1000 1000, 1000 600, 600 600)", "polygon": null,
"rotation_angle": 0, "rotation_angle": 0,
"mirrored": false, "mirrored": false,
"confidence": null "confidence": null
...@@ -1360,91 +1360,91 @@ ...@@ -1360,91 +1360,91 @@
}, },
{ {
"model": "documents.entitytype", "model": "documents.entitytype",
"pk": "4e1138f1-be4c-4205-834b-b2795e2bd1a3", "pk": "4e9c9ca3-03ae-4994-b617-4d78f0854dc0",
"fields": { "fields": {
"name": "date", "name": "person",
"color": "ff0000", "color": "ff0000",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a" "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337"
} }
}, },
{ {
"model": "documents.entitytype", "model": "documents.entitytype",
"pk": "564768cc-38be-45be-9e61-8dcade951c00", "pk": "8c7ad642-50eb-4125-899b-aa3d03024a47",
"fields": { "fields": {
"name": "location", "name": "location",
"color": "ff0000", "color": "ff0000",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a" "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337"
} }
}, },
{ {
"model": "documents.entitytype", "model": "documents.entitytype",
"pk": "a773549d-4adf-4dde-a595-3b2318f5cc0d", "pk": "95fcaaf8-6a17-4540-8a76-866a6cad9f1d",
"fields": { "fields": {
"name": "person", "name": "number",
"color": "ff0000", "color": "ff0000",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a" "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337"
} }
}, },
{ {
"model": "documents.entitytype", "model": "documents.entitytype",
"pk": "e19eb34b-55eb-4a8f-8019-18eea8e62fba", "pk": "974f88d0-2e4c-4a9e-85b7-2e244c2e883f",
"fields": { "fields": {
"name": "number", "name": "date",
"color": "ff0000", "color": "ff0000",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a" "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337"
} }
}, },
{ {
"model": "documents.entitytype", "model": "documents.entitytype",
"pk": "e96f8757-37d7-4457-9f2a-8e870cdadae5", "pk": "e82c02b6-9b63-483a-a3c0-94fe032d83f8",
"fields": { "fields": {
"name": "organization", "name": "organization",
"color": "ff0000", "color": "ff0000",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a" "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337"
} }
}, },
{ {
"model": "documents.transcription", "model": "documents.transcription",
"pk": "28e2570a-4022-4718-8827-5be712a53d4b", "pk": "268de903-300e-4a00-8f10-e2e10ac2a733",
"fields": { "fields": {
"element": "3603393d-4831-4dbf-9672-3fbe1077e03a", "element": "60a6c062-1bbb-4e5f-82e7-37cb77d92419",
"worker_version": "70b6b804-b6f9-4efb-9d79-b8258c336eb7", "worker_version": "06e2171f-b7d6-49dc-90fc-d47784e6e334",
"worker_run": null, "worker_run": null,
"text": "ROY", "text": "DATUM",
"orientation": "horizontal-lr", "orientation": "horizontal-lr",
"confidence": 1.0 "confidence": 1.0
} }
}, },
{ {
"model": "documents.transcription", "model": "documents.transcription",
"pk": "626eaeaf-ae24-4bc0-b1f6-78ad744a3645", "pk": "53d8a708-cd44-40b8-8862-7f663ece1133",
"fields": { "fields": {
"element": "6c6a774e-88c3-40c5-9913-d7ec2a3d5125", "element": "e38ab791-092f-48eb-bb09-ea95e5a01998",
"worker_version": "70b6b804-b6f9-4efb-9d79-b8258c336eb7", "worker_version": "06e2171f-b7d6-49dc-90fc-d47784e6e334",
"worker_run": null, "worker_run": null,
"text": "Lorem ipsum dolor sit amet", "text": "ROY",
"orientation": "horizontal-lr", "orientation": "horizontal-lr",
"confidence": 1.0 "confidence": 1.0
} }
}, },
{ {
"model": "documents.transcription", "model": "documents.transcription",
"pk": "62b7b9e6-0869-444c-aa8b-054fc124f6d9", "pk": "56a95e2d-4262-42da-a435-a5f29c0bc094",
"fields": { "fields": {
"element": "a8c108a2-a6b7-4401-9d64-65cf263531a7", "element": "ba400ee3-7247-4c20-bef4-3a49ad9e2e77",
"worker_version": "70b6b804-b6f9-4efb-9d79-b8258c336eb7", "worker_version": "06e2171f-b7d6-49dc-90fc-d47784e6e334",
"worker_run": null, "worker_run": null,
"text": "ROY", "text": "PARIS",
"orientation": "horizontal-lr", "orientation": "horizontal-lr",
"confidence": 1.0 "confidence": 1.0
} }
}, },
{ {
"model": "documents.transcription", "model": "documents.transcription",
"pk": "6f477447-1b65-44f6-a912-6ff6b24165a2", "pk": "7591f452-3d64-4b43-9789-0f05f2dfd6f8",
"fields": { "fields": {
"element": "2c0f28b1-b8e9-4f08-9014-75ce7950ee6f", "element": "6452b6c6-3d58-48c2-9032-691095fe8317",
"worker_version": "70b6b804-b6f9-4efb-9d79-b8258c336eb7", "worker_version": "06e2171f-b7d6-49dc-90fc-d47784e6e334",
"worker_run": null, "worker_run": null,
"text": "ROY", "text": "ROY",
"orientation": "horizontal-lr", "orientation": "horizontal-lr",
...@@ -1453,111 +1453,111 @@ ...@@ -1453,111 +1453,111 @@
}, },
{ {
"model": "documents.transcription", "model": "documents.transcription",
"pk": "797bde96-8b76-4a9b-a4b9-b3378fcfdcdf", "pk": "9b348778-35b7-4ed8-8232-4a641d51118d",
"fields": { "fields": {
"element": "18ada82e-36c6-47e4-bcff-bee5aa63889b", "element": "7f80cd7d-f24f-4691-a139-0ce744ea7577",
"worker_version": "70b6b804-b6f9-4efb-9d79-b8258c336eb7", "worker_version": "06e2171f-b7d6-49dc-90fc-d47784e6e334",
"worker_run": null, "worker_run": null,
"text": "DATUM", "text": "PARIS",
"orientation": "horizontal-lr", "orientation": "horizontal-lr",
"confidence": 1.0 "confidence": 1.0
} }
}, },
{ {
"model": "documents.transcription", "model": "documents.transcription",
"pk": "7b0f48b5-0580-47ef-9927-5e5fbdb749ff", "pk": "dd193fa4-103c-43ae-8914-ed24f2487251",
"fields": { "fields": {
"element": "469f4606-f5ea-406d-a0bd-6d48050c39ed", "element": "7cd8a970-ca3a-479f-b49e-1292b216c1b9",
"worker_version": "70b6b804-b6f9-4efb-9d79-b8258c336eb7", "worker_version": "06e2171f-b7d6-49dc-90fc-d47784e6e334",
"worker_run": null, "worker_run": null,
"text": "PARIS", "text": "DATUM",
"orientation": "horizontal-lr", "orientation": "horizontal-lr",
"confidence": 1.0 "confidence": 1.0
} }
}, },
{ {
"model": "documents.transcription", "model": "documents.transcription",
"pk": "a94dabcd-9e37-4cbc-a45a-6e9a5a76b01a", "pk": "de4d3e9b-597b-483a-8178-0c78328655bf",
"fields": { "fields": {
"element": "d3dc3f63-9894-434b-9715-7bd906b63e63", "element": "66843ee4-559b-4d2d-a9ce-4dd425022159",
"worker_version": "70b6b804-b6f9-4efb-9d79-b8258c336eb7", "worker_version": "06e2171f-b7d6-49dc-90fc-d47784e6e334",
"worker_run": null, "worker_run": null,
"text": "PARIS", "text": "ROY",
"orientation": "horizontal-lr", "orientation": "horizontal-lr",
"confidence": 1.0 "confidence": 1.0
} }
}, },
{ {
"model": "documents.transcription", "model": "documents.transcription",
"pk": "e74d7029-86e6-41ad-beed-12f4b215fb57", "pk": "e37e143e-c6b5-4b3f-82ce-37e60fd188c1",
"fields": { "fields": {
"element": "34cdee1d-40e3-4499-b04b-93f6d2bfb802", "element": "1f20a3a4-33be-43a3-9427-393799aba6d7",
"worker_version": "70b6b804-b6f9-4efb-9d79-b8258c336eb7", "worker_version": "06e2171f-b7d6-49dc-90fc-d47784e6e334",
"worker_run": null, "worker_run": null,
"text": "DATUM", "text": "PARIS",
"orientation": "horizontal-lr", "orientation": "horizontal-lr",
"confidence": 1.0 "confidence": 1.0
} }
}, },
{ {
"model": "documents.transcription", "model": "documents.transcription",
"pk": "eae51f9a-eb40-4d27-946f-274231062d30", "pk": "e41a7db5-5c44-4a14-88e9-92d7769263ca",
"fields": { "fields": {
"element": "92101c2b-885f-42e2-a0cb-13a8a04c0ea8", "element": "c80311e3-4529-45d6-9575-31b362c99925",
"worker_version": "70b6b804-b6f9-4efb-9d79-b8258c336eb7", "worker_version": "06e2171f-b7d6-49dc-90fc-d47784e6e334",
"worker_run": null, "worker_run": null,
"text": "PARIS", "text": "DATUM",
"orientation": "horizontal-lr", "orientation": "horizontal-lr",
"confidence": 1.0 "confidence": 1.0
} }
}, },
{ {
"model": "documents.transcription", "model": "documents.transcription",
"pk": "fb8d4786-a627-4049-9433-20755e7f3ca5", "pk": "fe88b0e9-117e-4c9b-a761-a8e63f2f095a",
"fields": { "fields": {
"element": "b0a0984b-dcf2-46da-8d6e-933020a46011", "element": "67482d70-765b-4092-b462-2d955fd8a7df",
"worker_version": "70b6b804-b6f9-4efb-9d79-b8258c336eb7", "worker_version": "06e2171f-b7d6-49dc-90fc-d47784e6e334",
"worker_run": null, "worker_run": null,
"text": "DATUM", "text": "Lorem ipsum dolor sit amet",
"orientation": "horizontal-lr", "orientation": "horizontal-lr",
"confidence": 1.0 "confidence": 1.0
} }
}, },
{ {
"model": "documents.allowedmetadata", "model": "documents.allowedmetadata",
"pk": "7c15d98e-10f2-4c0b-809f-b65242d5e74b", "pk": "13e9fa71-94a9-4e47-95a4-291597a811ef",
"fields": { "fields": {
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "date", "type": "text",
"name": "date" "name": "folio"
} }
}, },
{ {
"model": "documents.allowedmetadata", "model": "documents.allowedmetadata",
"pk": "819968c2-2433-4597-ac8b-852ed3397a9a", "pk": "721a146d-a883-4f73-981a-1d90744d6d13",
"fields": { "fields": {
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "location", "type": "date",
"name": "location" "name": "date"
} }
}, },
{ {
"model": "documents.allowedmetadata", "model": "documents.allowedmetadata",
"pk": "c079f5d7-f039-43a5-93c6-9019e8203e6b", "pk": "7b693888-219e-4f24-a930-de812973dc27",
"fields": { "fields": {
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"type": "text", "type": "location",
"name": "folio" "name": "location"
} }
}, },
{ {
"model": "documents.metadata", "model": "documents.metadata",
"pk": "03221610-3351-472d-9f7e-b23d7cbc7b92", "pk": "0d46167f-853f-4a07-b780-216a8c400aa3",
"fields": { "fields": {
"element": "6a41ddf7-41e4-40ad-8234-d773b74058bc", "element": "8349d4ba-fd23-4da6-a99b-76ba2e359b6f",
"name": "folio", "name": "number",
"type": "text", "type": "text",
"value": "1v", "value": "3",
"entity": null, "entity": null,
"worker_version": null, "worker_version": null,
"worker_run": null "worker_run": null
...@@ -1565,12 +1565,12 @@ ...@@ -1565,12 +1565,12 @@
}, },
{ {
"model": "documents.metadata", "model": "documents.metadata",
"pk": "18459ddf-615f-47cc-8de6-11ab62446632", "pk": "2cafc35d-ea3c-48cb-a93c-907d6f0a8643",
"fields": { "fields": {
"element": "664f19d6-472d-49cc-bd87-26c19db7d2d3", "element": "2aaa4788-127e-464c-bd8c-cd938796d207",
"name": "number", "name": "folio",
"type": "text", "type": "text",
"value": "2", "value": "1r",
"entity": null, "entity": null,
"worker_version": null, "worker_version": null,
"worker_run": null "worker_run": null
...@@ -1578,12 +1578,12 @@ ...@@ -1578,12 +1578,12 @@
}, },
{ {
"model": "documents.metadata", "model": "documents.metadata",
"pk": "34ec1306-1d88-4fc4-8049-d157252c5d51", "pk": "435e31bc-7844-474b-aff4-c3b8fcc6927a",
"fields": { "fields": {
"element": "6c6a774e-88c3-40c5-9913-d7ec2a3d5125", "element": "43ba23ed-3e59-466d-b48f-35928d3d9a59",
"name": "folio", "name": "number",
"type": "text", "type": "text",
"value": "1r", "value": "1",
"entity": null, "entity": null,
"worker_version": null, "worker_version": null,
"worker_run": null "worker_run": null
...@@ -1591,12 +1591,12 @@ ...@@ -1591,12 +1591,12 @@
}, },
{ {
"model": "documents.metadata", "model": "documents.metadata",
"pk": "5712f834-778d-450b-ba46-86262c4a13f8", "pk": "44548048-3180-4912-9134-10ae87037392",
"fields": { "fields": {
"element": "ba888ed5-8c85-4f49-8f87-499219187ade", "element": "737db4ff-8119-4e12-be99-968d7fa3be22",
"name": "number", "name": "folio",
"type": "text", "type": "text",
"value": "3", "value": "2r",
"entity": null, "entity": null,
"worker_version": null, "worker_version": null,
"worker_run": null "worker_run": null
...@@ -1604,9 +1604,9 @@ ...@@ -1604,9 +1604,9 @@
}, },
{ {
"model": "documents.metadata", "model": "documents.metadata",
"pk": "7d8d0dc1-fcf6-4e47-9b03-25d5baaac590", "pk": "57fb874a-5aa8-4526-9cf8-ad5c10b38d24",
"fields": { "fields": {
"element": "86f68e65-f23b-4d01-a9ca-c40eed9cda32", "element": "8144a0f8-f75b-43fa-ac27-d49d69bc483c",
"name": "number", "name": "number",
"type": "text", "type": "text",
"value": "4", "value": "4",
...@@ -1617,12 +1617,12 @@ ...@@ -1617,12 +1617,12 @@
}, },
{ {
"model": "documents.metadata", "model": "documents.metadata",
"pk": "820d9d2f-c6d0-40df-9bce-cb9062f17b0b", "pk": "9ea4ce55-d95c-46d2-802e-89f98abe862b",
"fields": { "fields": {
"element": "60313262-3273-4c39-a8ee-cedc733f6990", "element": "f09bebdb-152e-427c-ae2b-2e296982f342",
"name": "folio", "name": "folio",
"type": "text", "type": "text",
"value": "1r", "value": "2r",
"entity": null, "entity": null,
"worker_version": null, "worker_version": null,
"worker_run": null "worker_run": null
...@@ -1630,12 +1630,12 @@ ...@@ -1630,12 +1630,12 @@
}, },
{ {
"model": "documents.metadata", "model": "documents.metadata",
"pk": "93e2a919-9320-47ce-9b0f-de178dab40bc", "pk": "b22d936a-386d-48e3-88e0-6b88da42c982",
"fields": { "fields": {
"element": "3f3bb3ee-ec7c-436c-9dde-f8aa0e1a69d7", "element": "492ea0b0-bcaf-4a46-a15a-29cd08e32d90",
"name": "number", "name": "folio",
"type": "text", "type": "text",
"value": "5", "value": "1v",
"entity": null, "entity": null,
"worker_version": null, "worker_version": null,
"worker_run": null "worker_run": null
...@@ -1643,12 +1643,12 @@ ...@@ -1643,12 +1643,12 @@
}, },
{ {
"model": "documents.metadata", "model": "documents.metadata",
"pk": "9fc32596-bd62-4f8d-894d-abfeefc6157a", "pk": "d58788f8-58a9-488a-bef9-0302705ff942",
"fields": { "fields": {
"element": "4d2f59fe-9808-44b1-b3b5-017490ae4064", "element": "f8d56f23-51f6-40dd-9482-939a1dd877b3",
"name": "folio", "name": "number",
"type": "text", "type": "text",
"value": "2r", "value": "5",
"entity": null, "entity": null,
"worker_version": null, "worker_version": null,
"worker_run": null "worker_run": null
...@@ -1656,12 +1656,12 @@ ...@@ -1656,12 +1656,12 @@
}, },
{ {
"model": "documents.metadata", "model": "documents.metadata",
"pk": "ba9916fa-52e6-4203-8db4-662f9083c70c", "pk": "de810d60-9a4b-42e3-85c4-7a2174a01213",
"fields": { "fields": {
"element": "c16df32e-03b5-47e4-868f-98d57eac1f15", "element": "a0373c38-907d-4127-9762-5aada56b7165",
"name": "folio", "name": "number",
"type": "text", "type": "text",
"value": "1v", "value": "2",
"entity": null, "entity": null,
"worker_version": null, "worker_version": null,
"worker_run": null "worker_run": null
...@@ -1669,12 +1669,12 @@ ...@@ -1669,12 +1669,12 @@
}, },
{ {
"model": "documents.metadata", "model": "documents.metadata",
"pk": "bf7933a6-1646-40d0-be66-1306bc564481", "pk": "e4b071a7-41f5-416f-aeee-53ca55d4b640",
"fields": { "fields": {
"element": "b8c4d1e3-aa9d-425a-b70f-c8ff16ae147c", "element": "67482d70-765b-4092-b462-2d955fd8a7df",
"name": "folio", "name": "folio",
"type": "text", "type": "text",
"value": "2r", "value": "1r",
"entity": null, "entity": null,
"worker_version": null, "worker_version": null,
"worker_run": null "worker_run": null
...@@ -1682,12 +1682,12 @@ ...@@ -1682,12 +1682,12 @@
}, },
{ {
"model": "documents.metadata", "model": "documents.metadata",
"pk": "cffe6d09-810c-4365-8107-af240d60097e", "pk": "fec9c649-5fd4-43f7-ab28-3b364b868087",
"fields": { "fields": {
"element": "d227268a-2c2e-40ff-b22c-ab6e52eb5bba", "element": "7ac6504c-4088-4e6e-9a48-567f1f7e54c8",
"name": "number", "name": "folio",
"type": "text", "type": "text",
"value": "1", "value": "1v",
"entity": null, "entity": null,
"worker_version": null, "worker_version": null,
"worker_run": null "worker_run": null
...@@ -1710,12 +1710,12 @@ ...@@ -1710,12 +1710,12 @@
}, },
{ {
"model": "images.image", "model": "images.image",
"pk": "2552f45d-6880-4a4c-b9c2-1091598a52b4", "pk": "4867c2a1-fadc-4086-842c-c914b678d37d",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"server": 1, "server": 1,
"path": "img4", "path": "img5",
"width": 1000, "width": 1000,
"height": 1000, "height": 1000,
"hash": null, "hash": null,
...@@ -1724,12 +1724,12 @@ ...@@ -1724,12 +1724,12 @@
}, },
{ {
"model": "images.image", "model": "images.image",
"pk": "47f164d3-d26f-41e8-9df1-b538645d60b5", "pk": "627a53a6-466c-4114-b826-852ecd328e47",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"server": 1, "server": 1,
"path": "img2", "path": "img1",
"width": 1000, "width": 1000,
"height": 1000, "height": 1000,
"hash": null, "hash": null,
...@@ -1738,12 +1738,12 @@ ...@@ -1738,12 +1738,12 @@
}, },
{ {
"model": "images.image", "model": "images.image",
"pk": "4b93eabe-b42d-4b88-8f31-a63d0258000a", "pk": "68df44c1-ed1f-4f29-870d-de7b4b03b1a5",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"server": 1, "server": 1,
"path": "img6", "path": "img3",
"width": 1000, "width": 1000,
"height": 1000, "height": 1000,
"hash": null, "hash": null,
...@@ -1752,12 +1752,12 @@ ...@@ -1752,12 +1752,12 @@
}, },
{ {
"model": "images.image", "model": "images.image",
"pk": "5de01fda-de62-4d26-b8bf-5c3f4678de3b", "pk": "7f006318-b3d2-4cda-b1ab-8ff844c07b35",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"server": 1, "server": 1,
"path": "img5", "path": "img2",
"width": 1000, "width": 1000,
"height": 1000, "height": 1000,
"hash": null, "hash": null,
...@@ -1766,12 +1766,12 @@ ...@@ -1766,12 +1766,12 @@
}, },
{ {
"model": "images.image", "model": "images.image",
"pk": "d3547a48-79f6-4c1f-8f16-c0be1a1da9fc", "pk": "a68c21d7-d24f-44d7-b134-3c50ee6ddba1",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"server": 1, "server": 1,
"path": "img1", "path": "img4",
"width": 1000, "width": 1000,
"height": 1000, "height": 1000,
"hash": null, "hash": null,
...@@ -1780,12 +1780,12 @@ ...@@ -1780,12 +1780,12 @@
}, },
{ {
"model": "images.image", "model": "images.image",
"pk": "d4db6162-7d7b-4839-a84f-756e74fef150", "pk": "d7f4c84a-8aae-4c7d-86ce-567c5d4adc6d",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"server": 1, "server": 1,
"path": "img3", "path": "img6",
"width": 1000, "width": 1000,
"height": 1000, "height": 1000,
"hash": null, "hash": null,
...@@ -1794,56 +1794,56 @@ ...@@ -1794,56 +1794,56 @@
}, },
{ {
"model": "users.right", "model": "users.right",
"pk": "066494da-9d28-44a8-ad04-0616cde80af0", "pk": "053efd1b-d12f-49e5-ae72-54c7008224ec",
"fields": { "fields": {
"user": 2, "user": 2,
"group": null, "group": null,
"content_type": 20, "content_type": 19,
"content_id": "fdbe4b5c-9475-4310-8877-eb07344e294a", "content_id": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"level": 100 "level": 100
} }
}, },
{ {
"model": "users.right", "model": "users.right",
"pk": "58ce1f20-32a1-4507-8edd-28fff7a1a77f", "pk": "3e267701-586a-45f5-adf3-20bab26fbaae",
"fields": { "fields": {
"user": 2, "user": 2,
"group": null, "group": null,
"content_type": 12, "content_type": 34,
"content_id": "c19116b6-866f-4bb7-b447-3544629a8151", "content_id": "192deb9f-d37e-4edd-bb9b-2ae35c7ecba5",
"level": 10 "level": 100
} }
}, },
{ {
"model": "users.right", "model": "users.right",
"pk": "9f94b10b-ffd6-4a87-885d-af494d41c850", "pk": "7c7634a0-2cd6-4d54-9a1b-14b0c0390050",
"fields": { "fields": {
"user": 3, "user": 2,
"group": null, "group": null,
"content_type": 35, "content_type": 11,
"content_id": "c104ee5f-be60-4cdd-a738-10bf24601682", "content_id": "94055f35-9ac9-44a0-ac5d-386e132bea2c",
"level": 50 "level": 10
} }
}, },
{ {
"model": "users.right", "model": "users.right",
"pk": "b04e5fb5-dbca-4255-aae1-4c100c510c9d", "pk": "9f79af1d-f49f-4fd7-8504-2553ceab64db",
"fields": { "fields": {
"user": 2, "user": 3,
"group": null, "group": null,
"content_type": 35, "content_type": 34,
"content_id": "c104ee5f-be60-4cdd-a738-10bf24601682", "content_id": "192deb9f-d37e-4edd-bb9b-2ae35c7ecba5",
"level": 100 "level": 50
} }
}, },
{ {
"model": "users.right", "model": "users.right",
"pk": "da8297fb-5484-4511-8d29-0e8d6cbccc49", "pk": "f38dad9a-d7b5-43cc-8ec7-e437296a0ca4",
"fields": { "fields": {
"user": 4, "user": 4,
"group": null, "group": null,
"content_type": 35, "content_type": 34,
"content_id": "c104ee5f-be60-4cdd-a738-10bf24601682", "content_id": "192deb9f-d37e-4edd-bb9b-2ae35c7ecba5",
"level": 10 "level": 10
} }
}, },
...@@ -1851,7 +1851,7 @@ ...@@ -1851,7 +1851,7 @@
"model": "users.user", "model": "users.user",
"pk": 1, "pk": 1,
"fields": { "fields": {
"password": "pbkdf2_sha256$390000$IL4asfhs96nzQKK9md5Axl$uXyWwT/if+W9OsJ+OeHkPZWm4xlQ7D1ep2NyjxSNOLs=", "password": "pbkdf2_sha256$390000$uNaUvBneqUWhzAsyWIWTw0$2Q13vkqIe5EhzX9rxV94tnAAuzYxXL1OMkfD49k8j0U=",
"last_login": null, "last_login": null,
"email": "root@root.fr", "email": "root@root.fr",
"display_name": "Admin", "display_name": "Admin",
...@@ -1866,7 +1866,7 @@ ...@@ -1866,7 +1866,7 @@
"model": "users.user", "model": "users.user",
"pk": 2, "pk": 2,
"fields": { "fields": {
"password": "pbkdf2_sha256$390000$RvCTxXTmAXRgZ29LJrofXG$vnWF7puXQBP+G8wcclsOrd2ZpHbiq7jC/kX7F31tSQQ=", "password": "pbkdf2_sha256$390000$c0a4pOThTZIgnvLuFhk0M8$uY0aZIWY33541EueCEsJwiSn9JV4/xMmblh2ZB+iJIQ=",
"last_login": null, "last_login": null,
"email": "user@user.fr", "email": "user@user.fr",
"display_name": "Test user", "display_name": "Test user",
...@@ -1909,7 +1909,7 @@ ...@@ -1909,7 +1909,7 @@
}, },
{ {
"model": "users.group", "model": "users.group",
"pk": "c104ee5f-be60-4cdd-a738-10bf24601682", "pk": "192deb9f-d37e-4edd-bb9b-2ae35c7ecba5",
"fields": { "fields": {
"name": "User group", "name": "User group",
"public": false, "public": false,
...@@ -1921,7 +1921,7 @@ ...@@ -1921,7 +1921,7 @@
"pk": 1, "pk": 1,
"fields": { "fields": {
"name": "Can add log entry", "name": "Can add log entry",
"content_type": 3, "content_type": 1,
"codename": "add_logentry" "codename": "add_logentry"
} }
}, },
...@@ -1930,7 +1930,7 @@ ...@@ -1930,7 +1930,7 @@
"pk": 2, "pk": 2,
"fields": { "fields": {
"name": "Can change log entry", "name": "Can change log entry",
"content_type": 3, "content_type": 1,
"codename": "change_logentry" "codename": "change_logentry"
} }
}, },
...@@ -1939,7 +1939,7 @@ ...@@ -1939,7 +1939,7 @@
"pk": 3, "pk": 3,
"fields": { "fields": {
"name": "Can delete log entry", "name": "Can delete log entry",
"content_type": 3, "content_type": 1,
"codename": "delete_logentry" "codename": "delete_logentry"
} }
}, },
...@@ -1948,7 +1948,7 @@ ...@@ -1948,7 +1948,7 @@
"pk": 4, "pk": 4,
"fields": { "fields": {
"name": "Can view log entry", "name": "Can view log entry",
"content_type": 3, "content_type": 1,
"codename": "view_logentry" "codename": "view_logentry"
} }
}, },
...@@ -1957,7 +1957,7 @@ ...@@ -1957,7 +1957,7 @@
"pk": 5, "pk": 5,
"fields": { "fields": {
"name": "Can add permission", "name": "Can add permission",
"content_type": 4, "content_type": 2,
"codename": "add_permission" "codename": "add_permission"
} }
}, },
...@@ -1966,7 +1966,7 @@ ...@@ -1966,7 +1966,7 @@
"pk": 6, "pk": 6,
"fields": { "fields": {
"name": "Can change permission", "name": "Can change permission",
"content_type": 4, "content_type": 2,
"codename": "change_permission" "codename": "change_permission"
} }
}, },
...@@ -1975,7 +1975,7 @@ ...@@ -1975,7 +1975,7 @@
"pk": 7, "pk": 7,
"fields": { "fields": {
"name": "Can delete permission", "name": "Can delete permission",
"content_type": 4, "content_type": 2,
"codename": "delete_permission" "codename": "delete_permission"
} }
}, },
...@@ -1984,7 +1984,7 @@ ...@@ -1984,7 +1984,7 @@
"pk": 8, "pk": 8,
"fields": { "fields": {
"name": "Can view permission", "name": "Can view permission",
"content_type": 4, "content_type": 2,
"codename": "view_permission" "codename": "view_permission"
} }
}, },
...@@ -1993,7 +1993,7 @@ ...@@ -1993,7 +1993,7 @@
"pk": 9, "pk": 9,
"fields": { "fields": {
"name": "Can add group", "name": "Can add group",
"content_type": 5, "content_type": 3,
"codename": "add_group" "codename": "add_group"
} }
}, },
...@@ -2002,7 +2002,7 @@ ...@@ -2002,7 +2002,7 @@
"pk": 10, "pk": 10,
"fields": { "fields": {
"name": "Can change group", "name": "Can change group",
"content_type": 5, "content_type": 3,
"codename": "change_group" "codename": "change_group"
} }
}, },
...@@ -2011,7 +2011,7 @@ ...@@ -2011,7 +2011,7 @@
"pk": 11, "pk": 11,
"fields": { "fields": {
"name": "Can delete group", "name": "Can delete group",
"content_type": 5, "content_type": 3,
"codename": "delete_group" "codename": "delete_group"
} }
}, },
...@@ -2020,7 +2020,7 @@ ...@@ -2020,7 +2020,7 @@
"pk": 12, "pk": 12,
"fields": { "fields": {
"name": "Can view group", "name": "Can view group",
"content_type": 5, "content_type": 3,
"codename": "view_group" "codename": "view_group"
} }
}, },
...@@ -2029,7 +2029,7 @@ ...@@ -2029,7 +2029,7 @@
"pk": 13, "pk": 13,
"fields": { "fields": {
"name": "Can add content type", "name": "Can add content type",
"content_type": 6, "content_type": 4,
"codename": "add_contenttype" "codename": "add_contenttype"
} }
}, },
...@@ -2038,7 +2038,7 @@ ...@@ -2038,7 +2038,7 @@
"pk": 14, "pk": 14,
"fields": { "fields": {
"name": "Can change content type", "name": "Can change content type",
"content_type": 6, "content_type": 4,
"codename": "change_contenttype" "codename": "change_contenttype"
} }
}, },
...@@ -2047,7 +2047,7 @@ ...@@ -2047,7 +2047,7 @@
"pk": 15, "pk": 15,
"fields": { "fields": {
"name": "Can delete content type", "name": "Can delete content type",
"content_type": 6, "content_type": 4,
"codename": "delete_contenttype" "codename": "delete_contenttype"
} }
}, },
...@@ -2056,7 +2056,7 @@ ...@@ -2056,7 +2056,7 @@
"pk": 16, "pk": 16,
"fields": { "fields": {
"name": "Can view content type", "name": "Can view content type",
"content_type": 6, "content_type": 4,
"codename": "view_contenttype" "codename": "view_contenttype"
} }
}, },
...@@ -2065,7 +2065,7 @@ ...@@ -2065,7 +2065,7 @@
"pk": 17, "pk": 17,
"fields": { "fields": {
"name": "Can add session", "name": "Can add session",
"content_type": 7, "content_type": 5,
"codename": "add_session" "codename": "add_session"
} }
}, },
...@@ -2074,7 +2074,7 @@ ...@@ -2074,7 +2074,7 @@
"pk": 18, "pk": 18,
"fields": { "fields": {
"name": "Can change session", "name": "Can change session",
"content_type": 7, "content_type": 5,
"codename": "change_session" "codename": "change_session"
} }
}, },
...@@ -2083,7 +2083,7 @@ ...@@ -2083,7 +2083,7 @@
"pk": 19, "pk": 19,
"fields": { "fields": {
"name": "Can delete session", "name": "Can delete session",
"content_type": 7, "content_type": 5,
"codename": "delete_session" "codename": "delete_session"
} }
}, },
...@@ -2092,7 +2092,7 @@ ...@@ -2092,7 +2092,7 @@
"pk": 20, "pk": 20,
"fields": { "fields": {
"name": "Can view session", "name": "Can view session",
"content_type": 7, "content_type": 5,
"codename": "view_session" "codename": "view_session"
} }
}, },
...@@ -2101,7 +2101,7 @@ ...@@ -2101,7 +2101,7 @@
"pk": 21, "pk": 21,
"fields": { "fields": {
"name": "Can add Token", "name": "Can add Token",
"content_type": 8, "content_type": 6,
"codename": "add_token" "codename": "add_token"
} }
}, },
...@@ -2110,7 +2110,7 @@ ...@@ -2110,7 +2110,7 @@
"pk": 22, "pk": 22,
"fields": { "fields": {
"name": "Can change Token", "name": "Can change Token",
"content_type": 8, "content_type": 6,
"codename": "change_token" "codename": "change_token"
} }
}, },
...@@ -2119,7 +2119,7 @@ ...@@ -2119,7 +2119,7 @@
"pk": 23, "pk": 23,
"fields": { "fields": {
"name": "Can delete Token", "name": "Can delete Token",
"content_type": 8, "content_type": 6,
"codename": "delete_token" "codename": "delete_token"
} }
}, },
...@@ -2128,7 +2128,7 @@ ...@@ -2128,7 +2128,7 @@
"pk": 24, "pk": 24,
"fields": { "fields": {
"name": "Can view Token", "name": "Can view Token",
"content_type": 8, "content_type": 6,
"codename": "view_token" "codename": "view_token"
} }
}, },
...@@ -2137,7 +2137,7 @@ ...@@ -2137,7 +2137,7 @@
"pk": 25, "pk": 25,
"fields": { "fields": {
"name": "Can add token", "name": "Can add token",
"content_type": 9, "content_type": 7,
"codename": "add_tokenproxy" "codename": "add_tokenproxy"
} }
}, },
...@@ -2146,7 +2146,7 @@ ...@@ -2146,7 +2146,7 @@
"pk": 26, "pk": 26,
"fields": { "fields": {
"name": "Can change token", "name": "Can change token",
"content_type": 9, "content_type": 7,
"codename": "change_tokenproxy" "codename": "change_tokenproxy"
} }
}, },
...@@ -2155,7 +2155,7 @@ ...@@ -2155,7 +2155,7 @@
"pk": 27, "pk": 27,
"fields": { "fields": {
"name": "Can delete token", "name": "Can delete token",
"content_type": 9, "content_type": 7,
"codename": "delete_tokenproxy" "codename": "delete_tokenproxy"
} }
}, },
...@@ -2164,7 +2164,7 @@ ...@@ -2164,7 +2164,7 @@
"pk": 28, "pk": 28,
"fields": { "fields": {
"name": "Can view token", "name": "Can view token",
"content_type": 9, "content_type": 7,
"codename": "view_tokenproxy" "codename": "view_tokenproxy"
} }
}, },
...@@ -2173,7 +2173,7 @@ ...@@ -2173,7 +2173,7 @@
"pk": 29, "pk": 29,
"fields": { "fields": {
"name": "Access admin page", "name": "Access admin page",
"content_type": 10, "content_type": 8,
"codename": "view" "codename": "view"
} }
}, },
...@@ -2182,7 +2182,7 @@ ...@@ -2182,7 +2182,7 @@
"pk": 30, "pk": 30,
"fields": { "fields": {
"name": "Can add agent", "name": "Can add agent",
"content_type": 1, "content_type": 9,
"codename": "add_agent" "codename": "add_agent"
} }
}, },
...@@ -2191,7 +2191,7 @@ ...@@ -2191,7 +2191,7 @@
"pk": 31, "pk": 31,
"fields": { "fields": {
"name": "Can change agent", "name": "Can change agent",
"content_type": 1, "content_type": 9,
"codename": "change_agent" "codename": "change_agent"
} }
}, },
...@@ -2200,7 +2200,7 @@ ...@@ -2200,7 +2200,7 @@
"pk": 32, "pk": 32,
"fields": { "fields": {
"name": "Can delete agent", "name": "Can delete agent",
"content_type": 1, "content_type": 9,
"codename": "delete_agent" "codename": "delete_agent"
} }
}, },
...@@ -2209,7 +2209,7 @@ ...@@ -2209,7 +2209,7 @@
"pk": 33, "pk": 33,
"fields": { "fields": {
"name": "Can view agent", "name": "Can view agent",
"content_type": 1, "content_type": 9,
"codename": "view_agent" "codename": "view_agent"
} }
}, },
...@@ -2218,7 +2218,7 @@ ...@@ -2218,7 +2218,7 @@
"pk": 34, "pk": 34,
"fields": { "fields": {
"name": "Can add artifact", "name": "Can add artifact",
"content_type": 11, "content_type": 10,
"codename": "add_artifact" "codename": "add_artifact"
} }
}, },
...@@ -2227,7 +2227,7 @@ ...@@ -2227,7 +2227,7 @@
"pk": 35, "pk": 35,
"fields": { "fields": {
"name": "Can change artifact", "name": "Can change artifact",
"content_type": 11, "content_type": 10,
"codename": "change_artifact" "codename": "change_artifact"
} }
}, },
...@@ -2236,7 +2236,7 @@ ...@@ -2236,7 +2236,7 @@
"pk": 36, "pk": 36,
"fields": { "fields": {
"name": "Can delete artifact", "name": "Can delete artifact",
"content_type": 11, "content_type": 10,
"codename": "delete_artifact" "codename": "delete_artifact"
} }
}, },
...@@ -2245,7 +2245,7 @@ ...@@ -2245,7 +2245,7 @@
"pk": 37, "pk": 37,
"fields": { "fields": {
"name": "Can view artifact", "name": "Can view artifact",
"content_type": 11, "content_type": 10,
"codename": "view_artifact" "codename": "view_artifact"
} }
}, },
...@@ -2254,7 +2254,7 @@ ...@@ -2254,7 +2254,7 @@
"pk": 38, "pk": 38,
"fields": { "fields": {
"name": "Can add farm", "name": "Can add farm",
"content_type": 12, "content_type": 11,
"codename": "add_farm" "codename": "add_farm"
} }
}, },
...@@ -2263,7 +2263,7 @@ ...@@ -2263,7 +2263,7 @@
"pk": 39, "pk": 39,
"fields": { "fields": {
"name": "Can change farm", "name": "Can change farm",
"content_type": 12, "content_type": 11,
"codename": "change_farm" "codename": "change_farm"
} }
}, },
...@@ -2272,7 +2272,7 @@ ...@@ -2272,7 +2272,7 @@
"pk": 40, "pk": 40,
"fields": { "fields": {
"name": "Can delete farm", "name": "Can delete farm",
"content_type": 12, "content_type": 11,
"codename": "delete_farm" "codename": "delete_farm"
} }
}, },
...@@ -2281,7 +2281,7 @@ ...@@ -2281,7 +2281,7 @@
"pk": 41, "pk": 41,
"fields": { "fields": {
"name": "Can view farm", "name": "Can view farm",
"content_type": 12, "content_type": 11,
"codename": "view_farm" "codename": "view_farm"
} }
}, },
...@@ -2290,7 +2290,7 @@ ...@@ -2290,7 +2290,7 @@
"pk": 42, "pk": 42,
"fields": { "fields": {
"name": "Can add gpu", "name": "Can add gpu",
"content_type": 13, "content_type": 12,
"codename": "add_gpu" "codename": "add_gpu"
} }
}, },
...@@ -2299,7 +2299,7 @@ ...@@ -2299,7 +2299,7 @@
"pk": 43, "pk": 43,
"fields": { "fields": {
"name": "Can change gpu", "name": "Can change gpu",
"content_type": 13, "content_type": 12,
"codename": "change_gpu" "codename": "change_gpu"
} }
}, },
...@@ -2308,7 +2308,7 @@ ...@@ -2308,7 +2308,7 @@
"pk": 44, "pk": 44,
"fields": { "fields": {
"name": "Can delete gpu", "name": "Can delete gpu",
"content_type": 13, "content_type": 12,
"codename": "delete_gpu" "codename": "delete_gpu"
} }
}, },
...@@ -2317,7 +2317,7 @@ ...@@ -2317,7 +2317,7 @@
"pk": 45, "pk": 45,
"fields": { "fields": {
"name": "Can view gpu", "name": "Can view gpu",
"content_type": 13, "content_type": 12,
"codename": "view_gpu" "codename": "view_gpu"
} }
}, },
...@@ -2326,7 +2326,7 @@ ...@@ -2326,7 +2326,7 @@
"pk": 46, "pk": 46,
"fields": { "fields": {
"name": "Can add secret", "name": "Can add secret",
"content_type": 14, "content_type": 13,
"codename": "add_secret" "codename": "add_secret"
} }
}, },
...@@ -2335,7 +2335,7 @@ ...@@ -2335,7 +2335,7 @@
"pk": 47, "pk": 47,
"fields": { "fields": {
"name": "Can change secret", "name": "Can change secret",
"content_type": 14, "content_type": 13,
"codename": "change_secret" "codename": "change_secret"
} }
}, },
...@@ -2344,7 +2344,7 @@ ...@@ -2344,7 +2344,7 @@
"pk": 48, "pk": 48,
"fields": { "fields": {
"name": "Can delete secret", "name": "Can delete secret",
"content_type": 14, "content_type": 13,
"codename": "delete_secret" "codename": "delete_secret"
} }
}, },
...@@ -2353,7 +2353,7 @@ ...@@ -2353,7 +2353,7 @@
"pk": 49, "pk": 49,
"fields": { "fields": {
"name": "Can view secret", "name": "Can view secret",
"content_type": 14, "content_type": 13,
"codename": "view_secret" "codename": "view_secret"
} }
}, },
...@@ -2362,7 +2362,7 @@ ...@@ -2362,7 +2362,7 @@
"pk": 50, "pk": 50,
"fields": { "fields": {
"name": "Can add task", "name": "Can add task",
"content_type": 15, "content_type": 14,
"codename": "add_task" "codename": "add_task"
} }
}, },
...@@ -2371,7 +2371,7 @@ ...@@ -2371,7 +2371,7 @@
"pk": 51, "pk": 51,
"fields": { "fields": {
"name": "Can change task", "name": "Can change task",
"content_type": 15, "content_type": 14,
"codename": "change_task" "codename": "change_task"
} }
}, },
...@@ -2380,7 +2380,7 @@ ...@@ -2380,7 +2380,7 @@
"pk": 52, "pk": 52,
"fields": { "fields": {
"name": "Can delete task", "name": "Can delete task",
"content_type": 15, "content_type": 14,
"codename": "delete_task" "codename": "delete_task"
} }
}, },
...@@ -2389,7 +2389,7 @@ ...@@ -2389,7 +2389,7 @@
"pk": 53, "pk": 53,
"fields": { "fields": {
"name": "Can view task", "name": "Can view task",
"content_type": 15, "content_type": 14,
"codename": "view_task" "codename": "view_task"
} }
}, },
...@@ -2397,1561 +2397,1525 @@ ...@@ -2397,1561 +2397,1525 @@
"model": "auth.permission", "model": "auth.permission",
"pk": 54, "pk": 54,
"fields": { "fields": {
"name": "Can add agent user", "name": "Can add image",
"content_type": 2, "content_type": 15,
"codename": "add_agentuser" "codename": "add_image"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 55, "pk": 55,
"fields": { "fields": {
"name": "Can change agent user", "name": "Can change image",
"content_type": 2, "content_type": 15,
"codename": "change_agentuser" "codename": "change_image"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 56, "pk": 56,
"fields": { "fields": {
"name": "Can delete agent user", "name": "Can delete image",
"content_type": 2, "content_type": 15,
"codename": "delete_agentuser" "codename": "delete_image"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 57, "pk": 57,
"fields": { "fields": {
"name": "Can view agent user", "name": "Can view image",
"content_type": 2, "content_type": 15,
"codename": "view_agentuser" "codename": "view_image"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 58, "pk": 58,
"fields": { "fields": {
"name": "Can add image", "name": "Can add image server",
"content_type": 16, "content_type": 16,
"codename": "add_image"
}
},
{
"model": "auth.permission",
"pk": 59,
"fields": {
"name": "Can change image",
"content_type": 16,
"codename": "change_image"
}
},
{
"model": "auth.permission",
"pk": 60,
"fields": {
"name": "Can delete image",
"content_type": 16,
"codename": "delete_image"
}
},
{
"model": "auth.permission",
"pk": 61,
"fields": {
"name": "Can view image",
"content_type": 16,
"codename": "view_image"
}
},
{
"model": "auth.permission",
"pk": 62,
"fields": {
"name": "Can add image server",
"content_type": 17,
"codename": "add_imageserver" "codename": "add_imageserver"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 63, "pk": 59,
"fields": { "fields": {
"name": "Can change image server", "name": "Can change image server",
"content_type": 17, "content_type": 16,
"codename": "change_imageserver" "codename": "change_imageserver"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 64, "pk": 60,
"fields": { "fields": {
"name": "Can delete image server", "name": "Can delete image server",
"content_type": 17, "content_type": 16,
"codename": "delete_imageserver" "codename": "delete_imageserver"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 65, "pk": 61,
"fields": { "fields": {
"name": "Can view image server", "name": "Can view image server",
"content_type": 17, "content_type": 16,
"codename": "view_imageserver" "codename": "view_imageserver"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 66, "pk": 62,
"fields": { "fields": {
"name": "Can add allowed meta data", "name": "Can add allowed meta data",
"content_type": 18, "content_type": 17,
"codename": "add_allowedmetadata" "codename": "add_allowedmetadata"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 67, "pk": 63,
"fields": { "fields": {
"name": "Can change allowed meta data", "name": "Can change allowed meta data",
"content_type": 18, "content_type": 17,
"codename": "change_allowedmetadata" "codename": "change_allowedmetadata"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 68, "pk": 64,
"fields": { "fields": {
"name": "Can delete allowed meta data", "name": "Can delete allowed meta data",
"content_type": 18, "content_type": 17,
"codename": "delete_allowedmetadata" "codename": "delete_allowedmetadata"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 69, "pk": 65,
"fields": { "fields": {
"name": "Can view allowed meta data", "name": "Can view allowed meta data",
"content_type": 18, "content_type": 17,
"codename": "view_allowedmetadata" "codename": "view_allowedmetadata"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 70, "pk": 66,
"fields": { "fields": {
"name": "Can add classification", "name": "Can add classification",
"content_type": 19, "content_type": 18,
"codename": "add_classification" "codename": "add_classification"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 71, "pk": 67,
"fields": { "fields": {
"name": "Can change classification", "name": "Can change classification",
"content_type": 19, "content_type": 18,
"codename": "change_classification" "codename": "change_classification"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 72, "pk": 68,
"fields": { "fields": {
"name": "Can delete classification", "name": "Can delete classification",
"content_type": 19, "content_type": 18,
"codename": "delete_classification" "codename": "delete_classification"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 73, "pk": 69,
"fields": { "fields": {
"name": "Can view classification", "name": "Can view classification",
"content_type": 19, "content_type": 18,
"codename": "view_classification" "codename": "view_classification"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 74, "pk": 70,
"fields": { "fields": {
"name": "Can add corpus", "name": "Can add corpus",
"content_type": 20, "content_type": 19,
"codename": "add_corpus" "codename": "add_corpus"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 75, "pk": 71,
"fields": { "fields": {
"name": "Can change corpus", "name": "Can change corpus",
"content_type": 20, "content_type": 19,
"codename": "change_corpus" "codename": "change_corpus"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 76, "pk": 72,
"fields": { "fields": {
"name": "Can delete corpus", "name": "Can delete corpus",
"content_type": 20, "content_type": 19,
"codename": "delete_corpus" "codename": "delete_corpus"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 77, "pk": 73,
"fields": { "fields": {
"name": "Can view corpus", "name": "Can view corpus",
"content_type": 20, "content_type": 19,
"codename": "view_corpus" "codename": "view_corpus"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 78, "pk": 74,
"fields": { "fields": {
"name": "Can add corpus export", "name": "Can add corpus export",
"content_type": 21, "content_type": 20,
"codename": "add_corpusexport" "codename": "add_corpusexport"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 79, "pk": 75,
"fields": { "fields": {
"name": "Can change corpus export", "name": "Can change corpus export",
"content_type": 21, "content_type": 20,
"codename": "change_corpusexport" "codename": "change_corpusexport"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 80, "pk": 76,
"fields": { "fields": {
"name": "Can delete corpus export", "name": "Can delete corpus export",
"content_type": 21, "content_type": 20,
"codename": "delete_corpusexport" "codename": "delete_corpusexport"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 81, "pk": 77,
"fields": { "fields": {
"name": "Can view corpus export", "name": "Can view corpus export",
"content_type": 21, "content_type": 20,
"codename": "view_corpusexport" "codename": "view_corpusexport"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 82, "pk": 78,
"fields": { "fields": {
"name": "Can add element", "name": "Can add element",
"content_type": 22, "content_type": 21,
"codename": "add_element" "codename": "add_element"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 83, "pk": 79,
"fields": { "fields": {
"name": "Can change element", "name": "Can change element",
"content_type": 22, "content_type": 21,
"codename": "change_element" "codename": "change_element"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 84, "pk": 80,
"fields": { "fields": {
"name": "Can delete element", "name": "Can delete element",
"content_type": 22, "content_type": 21,
"codename": "delete_element" "codename": "delete_element"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 85, "pk": 81,
"fields": { "fields": {
"name": "Can view element", "name": "Can view element",
"content_type": 22, "content_type": 21,
"codename": "view_element" "codename": "view_element"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 86, "pk": 82,
"fields": { "fields": {
"name": "Can add element path", "name": "Can add element path",
"content_type": 23, "content_type": 22,
"codename": "add_elementpath" "codename": "add_elementpath"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 87, "pk": 83,
"fields": { "fields": {
"name": "Can change element path", "name": "Can change element path",
"content_type": 23, "content_type": 22,
"codename": "change_elementpath" "codename": "change_elementpath"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 88, "pk": 84,
"fields": { "fields": {
"name": "Can delete element path", "name": "Can delete element path",
"content_type": 23, "content_type": 22,
"codename": "delete_elementpath" "codename": "delete_elementpath"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 89, "pk": 85,
"fields": { "fields": {
"name": "Can view element path", "name": "Can view element path",
"content_type": 23, "content_type": 22,
"codename": "view_elementpath" "codename": "view_elementpath"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 90, "pk": 86,
"fields": { "fields": {
"name": "Can add element type", "name": "Can add element type",
"content_type": 24, "content_type": 23,
"codename": "add_elementtype" "codename": "add_elementtype"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 91, "pk": 87,
"fields": { "fields": {
"name": "Can change element type", "name": "Can change element type",
"content_type": 24, "content_type": 23,
"codename": "change_elementtype" "codename": "change_elementtype"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 92, "pk": 88,
"fields": { "fields": {
"name": "Can delete element type", "name": "Can delete element type",
"content_type": 24, "content_type": 23,
"codename": "delete_elementtype" "codename": "delete_elementtype"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 93, "pk": 89,
"fields": { "fields": {
"name": "Can view element type", "name": "Can view element type",
"content_type": 24, "content_type": 23,
"codename": "view_elementtype" "codename": "view_elementtype"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 94, "pk": 90,
"fields": { "fields": {
"name": "Can add entity", "name": "Can add entity",
"content_type": 25, "content_type": 24,
"codename": "add_entity" "codename": "add_entity"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 95, "pk": 91,
"fields": { "fields": {
"name": "Can change entity", "name": "Can change entity",
"content_type": 25, "content_type": 24,
"codename": "change_entity" "codename": "change_entity"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 96, "pk": 92,
"fields": { "fields": {
"name": "Can delete entity", "name": "Can delete entity",
"content_type": 25, "content_type": 24,
"codename": "delete_entity" "codename": "delete_entity"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 97, "pk": 93,
"fields": { "fields": {
"name": "Can view entity", "name": "Can view entity",
"content_type": 25, "content_type": 24,
"codename": "view_entity" "codename": "view_entity"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 98, "pk": 94,
"fields": { "fields": {
"name": "Can add entity link", "name": "Can add entity link",
"content_type": 26, "content_type": 25,
"codename": "add_entitylink" "codename": "add_entitylink"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 99, "pk": 95,
"fields": { "fields": {
"name": "Can change entity link", "name": "Can change entity link",
"content_type": 26, "content_type": 25,
"codename": "change_entitylink" "codename": "change_entitylink"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 100, "pk": 96,
"fields": { "fields": {
"name": "Can delete entity link", "name": "Can delete entity link",
"content_type": 26, "content_type": 25,
"codename": "delete_entitylink" "codename": "delete_entitylink"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 101, "pk": 97,
"fields": { "fields": {
"name": "Can view entity link", "name": "Can view entity link",
"content_type": 26, "content_type": 25,
"codename": "view_entitylink" "codename": "view_entitylink"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 102, "pk": 98,
"fields": { "fields": {
"name": "Can add entity role", "name": "Can add entity role",
"content_type": 27, "content_type": 26,
"codename": "add_entityrole" "codename": "add_entityrole"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 103, "pk": 99,
"fields": { "fields": {
"name": "Can change entity role", "name": "Can change entity role",
"content_type": 27, "content_type": 26,
"codename": "change_entityrole" "codename": "change_entityrole"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 104, "pk": 100,
"fields": { "fields": {
"name": "Can delete entity role", "name": "Can delete entity role",
"content_type": 27, "content_type": 26,
"codename": "delete_entityrole" "codename": "delete_entityrole"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 105, "pk": 101,
"fields": { "fields": {
"name": "Can view entity role", "name": "Can view entity role",
"content_type": 27, "content_type": 26,
"codename": "view_entityrole" "codename": "view_entityrole"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 106, "pk": 102,
"fields": { "fields": {
"name": "Can add entity type", "name": "Can add entity type",
"content_type": 28, "content_type": 27,
"codename": "add_entitytype" "codename": "add_entitytype"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 107, "pk": 103,
"fields": { "fields": {
"name": "Can change entity type", "name": "Can change entity type",
"content_type": 28, "content_type": 27,
"codename": "change_entitytype" "codename": "change_entitytype"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 108, "pk": 104,
"fields": { "fields": {
"name": "Can delete entity type", "name": "Can delete entity type",
"content_type": 28, "content_type": 27,
"codename": "delete_entitytype" "codename": "delete_entitytype"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 109, "pk": 105,
"fields": { "fields": {
"name": "Can view entity type", "name": "Can view entity type",
"content_type": 28, "content_type": 27,
"codename": "view_entitytype" "codename": "view_entitytype"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 110, "pk": 106,
"fields": { "fields": {
"name": "Can add meta data", "name": "Can add meta data",
"content_type": 29, "content_type": 28,
"codename": "add_metadata" "codename": "add_metadata"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 111, "pk": 107,
"fields": { "fields": {
"name": "Can change meta data", "name": "Can change meta data",
"content_type": 29, "content_type": 28,
"codename": "change_metadata" "codename": "change_metadata"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 112, "pk": 108,
"fields": { "fields": {
"name": "Can delete meta data", "name": "Can delete meta data",
"content_type": 29, "content_type": 28,
"codename": "delete_metadata" "codename": "delete_metadata"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 113, "pk": 109,
"fields": { "fields": {
"name": "Can view meta data", "name": "Can view meta data",
"content_type": 29, "content_type": 28,
"codename": "view_metadata" "codename": "view_metadata"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 114, "pk": 110,
"fields": { "fields": {
"name": "Can add ml class", "name": "Can add ml class",
"content_type": 30, "content_type": 29,
"codename": "add_mlclass" "codename": "add_mlclass"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 115, "pk": 111,
"fields": { "fields": {
"name": "Can change ml class", "name": "Can change ml class",
"content_type": 30, "content_type": 29,
"codename": "change_mlclass" "codename": "change_mlclass"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 116, "pk": 112,
"fields": { "fields": {
"name": "Can delete ml class", "name": "Can delete ml class",
"content_type": 30, "content_type": 29,
"codename": "delete_mlclass" "codename": "delete_mlclass"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 117, "pk": 113,
"fields": { "fields": {
"name": "Can view ml class", "name": "Can view ml class",
"content_type": 30, "content_type": 29,
"codename": "view_mlclass" "codename": "view_mlclass"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 118, "pk": 114,
"fields": { "fields": {
"name": "Can add selection", "name": "Can add selection",
"content_type": 31, "content_type": 30,
"codename": "add_selection" "codename": "add_selection"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 119, "pk": 115,
"fields": { "fields": {
"name": "Can change selection", "name": "Can change selection",
"content_type": 31, "content_type": 30,
"codename": "change_selection" "codename": "change_selection"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 120, "pk": 116,
"fields": { "fields": {
"name": "Can delete selection", "name": "Can delete selection",
"content_type": 31, "content_type": 30,
"codename": "delete_selection" "codename": "delete_selection"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 121, "pk": 117,
"fields": { "fields": {
"name": "Can view selection", "name": "Can view selection",
"content_type": 31, "content_type": 30,
"codename": "view_selection" "codename": "view_selection"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 122, "pk": 118,
"fields": { "fields": {
"name": "Can add transcription", "name": "Can add transcription",
"content_type": 32, "content_type": 31,
"codename": "add_transcription" "codename": "add_transcription"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 123, "pk": 119,
"fields": { "fields": {
"name": "Can change transcription", "name": "Can change transcription",
"content_type": 32, "content_type": 31,
"codename": "change_transcription" "codename": "change_transcription"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 124, "pk": 120,
"fields": { "fields": {
"name": "Can delete transcription", "name": "Can delete transcription",
"content_type": 32, "content_type": 31,
"codename": "delete_transcription" "codename": "delete_transcription"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 125, "pk": 121,
"fields": { "fields": {
"name": "Can view transcription", "name": "Can view transcription",
"content_type": 32, "content_type": 31,
"codename": "view_transcription" "codename": "view_transcription"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 126, "pk": 122,
"fields": { "fields": {
"name": "Can add transcription entity", "name": "Can add transcription entity",
"content_type": 33, "content_type": 32,
"codename": "add_transcriptionentity" "codename": "add_transcriptionentity"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 127, "pk": 123,
"fields": { "fields": {
"name": "Can change transcription entity", "name": "Can change transcription entity",
"content_type": 33, "content_type": 32,
"codename": "change_transcriptionentity" "codename": "change_transcriptionentity"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 128, "pk": 124,
"fields": { "fields": {
"name": "Can delete transcription entity", "name": "Can delete transcription entity",
"content_type": 33, "content_type": 32,
"codename": "delete_transcriptionentity" "codename": "delete_transcriptionentity"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 129, "pk": 125,
"fields": { "fields": {
"name": "Can view transcription entity", "name": "Can view transcription entity",
"content_type": 33, "content_type": 32,
"codename": "view_transcriptionentity" "codename": "view_transcriptionentity"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 130, "pk": 126,
"fields": { "fields": {
"name": "Can add user", "name": "Can add user",
"content_type": 34, "content_type": 33,
"codename": "add_user" "codename": "add_user"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 131, "pk": 127,
"fields": { "fields": {
"name": "Can change user", "name": "Can change user",
"content_type": 34, "content_type": 33,
"codename": "change_user" "codename": "change_user"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 132, "pk": 128,
"fields": { "fields": {
"name": "Can delete user", "name": "Can delete user",
"content_type": 34, "content_type": 33,
"codename": "delete_user" "codename": "delete_user"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 133, "pk": 129,
"fields": { "fields": {
"name": "Can view user", "name": "Can view user",
"content_type": 34, "content_type": 33,
"codename": "view_user" "codename": "view_user"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 134, "pk": 130,
"fields": { "fields": {
"name": "Can add group", "name": "Can add group",
"content_type": 35, "content_type": 34,
"codename": "add_group" "codename": "add_group"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 135, "pk": 131,
"fields": { "fields": {
"name": "Can change group", "name": "Can change group",
"content_type": 35, "content_type": 34,
"codename": "change_group" "codename": "change_group"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 136, "pk": 132,
"fields": { "fields": {
"name": "Can delete group", "name": "Can delete group",
"content_type": 35, "content_type": 34,
"codename": "delete_group" "codename": "delete_group"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 137, "pk": 133,
"fields": { "fields": {
"name": "Can view group", "name": "Can view group",
"content_type": 35, "content_type": 34,
"codename": "view_group" "codename": "view_group"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 138, "pk": 134,
"fields": { "fields": {
"name": "Can add right", "name": "Can add right",
"content_type": 36, "content_type": 35,
"codename": "add_right" "codename": "add_right"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 139, "pk": 135,
"fields": { "fields": {
"name": "Can change right", "name": "Can change right",
"content_type": 36, "content_type": 35,
"codename": "change_right" "codename": "change_right"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 140, "pk": 136,
"fields": { "fields": {
"name": "Can delete right", "name": "Can delete right",
"content_type": 36, "content_type": 35,
"codename": "delete_right" "codename": "delete_right"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 141, "pk": 137,
"fields": { "fields": {
"name": "Can view right", "name": "Can view right",
"content_type": 36, "content_type": 35,
"codename": "view_right" "codename": "view_right"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 142, "pk": 138,
"fields": { "fields": {
"name": "Can add user scope", "name": "Can add user scope",
"content_type": 37, "content_type": 36,
"codename": "add_userscope" "codename": "add_userscope"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 143, "pk": 139,
"fields": { "fields": {
"name": "Can change user scope", "name": "Can change user scope",
"content_type": 37, "content_type": 36,
"codename": "change_userscope" "codename": "change_userscope"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 144, "pk": 140,
"fields": { "fields": {
"name": "Can delete user scope", "name": "Can delete user scope",
"content_type": 37, "content_type": 36,
"codename": "delete_userscope" "codename": "delete_userscope"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 145, "pk": 141,
"fields": { "fields": {
"name": "Can view user scope", "name": "Can view user scope",
"content_type": 37, "content_type": 36,
"codename": "view_userscope" "codename": "view_userscope"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 146, "pk": 142,
"fields": { "fields": {
"name": "Can add corpus worker version", "name": "Can add corpus worker version",
"content_type": 38, "content_type": 37,
"codename": "add_corpusworkerversion" "codename": "add_corpusworkerversion"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 147, "pk": 143,
"fields": { "fields": {
"name": "Can change corpus worker version", "name": "Can change corpus worker version",
"content_type": 38, "content_type": 37,
"codename": "change_corpusworkerversion" "codename": "change_corpusworkerversion"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 148, "pk": 144,
"fields": { "fields": {
"name": "Can delete corpus worker version", "name": "Can delete corpus worker version",
"content_type": 38, "content_type": 37,
"codename": "delete_corpusworkerversion" "codename": "delete_corpusworkerversion"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 149, "pk": 145,
"fields": { "fields": {
"name": "Can view corpus worker version", "name": "Can view corpus worker version",
"content_type": 38, "content_type": 37,
"codename": "view_corpusworkerversion" "codename": "view_corpusworkerversion"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 150, "pk": 146,
"fields": { "fields": {
"name": "Can add data file", "name": "Can add data file",
"content_type": 39, "content_type": 38,
"codename": "add_datafile" "codename": "add_datafile"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 151, "pk": 147,
"fields": { "fields": {
"name": "Can change data file", "name": "Can change data file",
"content_type": 39, "content_type": 38,
"codename": "change_datafile" "codename": "change_datafile"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 152, "pk": 148,
"fields": { "fields": {
"name": "Can delete data file", "name": "Can delete data file",
"content_type": 39, "content_type": 38,
"codename": "delete_datafile" "codename": "delete_datafile"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 153, "pk": 149,
"fields": { "fields": {
"name": "Can view data file", "name": "Can view data file",
"content_type": 39, "content_type": 38,
"codename": "view_datafile" "codename": "view_datafile"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 154, "pk": 150,
"fields": { "fields": {
"name": "Can add git ref", "name": "Can add git ref",
"content_type": 40, "content_type": 39,
"codename": "add_gitref" "codename": "add_gitref"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 155, "pk": 151,
"fields": { "fields": {
"name": "Can change git ref", "name": "Can change git ref",
"content_type": 40, "content_type": 39,
"codename": "change_gitref" "codename": "change_gitref"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 156, "pk": 152,
"fields": { "fields": {
"name": "Can delete git ref", "name": "Can delete git ref",
"content_type": 40, "content_type": 39,
"codename": "delete_gitref" "codename": "delete_gitref"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 157, "pk": 153,
"fields": { "fields": {
"name": "Can view git ref", "name": "Can view git ref",
"content_type": 40, "content_type": 39,
"codename": "view_gitref" "codename": "view_gitref"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 158, "pk": 154,
"fields": { "fields": {
"name": "Can add process", "name": "Can add process",
"content_type": 41, "content_type": 40,
"codename": "add_process" "codename": "add_process"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 159, "pk": 155,
"fields": { "fields": {
"name": "Can change process", "name": "Can change process",
"content_type": 41, "content_type": 40,
"codename": "change_process" "codename": "change_process"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 160, "pk": 156,
"fields": { "fields": {
"name": "Can delete process", "name": "Can delete process",
"content_type": 41, "content_type": 40,
"codename": "delete_process" "codename": "delete_process"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 161, "pk": 157,
"fields": { "fields": {
"name": "Can view process", "name": "Can view process",
"content_type": 41, "content_type": 40,
"codename": "view_process" "codename": "view_process"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 162, "pk": 158,
"fields": { "fields": {
"name": "Can add process element", "name": "Can add process element",
"content_type": 42, "content_type": 41,
"codename": "add_processelement" "codename": "add_processelement"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 163, "pk": 159,
"fields": { "fields": {
"name": "Can change process element", "name": "Can change process element",
"content_type": 42, "content_type": 41,
"codename": "change_processelement" "codename": "change_processelement"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 164, "pk": 160,
"fields": { "fields": {
"name": "Can delete process element", "name": "Can delete process element",
"content_type": 42, "content_type": 41,
"codename": "delete_processelement" "codename": "delete_processelement"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 165, "pk": 161,
"fields": { "fields": {
"name": "Can view process element", "name": "Can view process element",
"content_type": 42, "content_type": 41,
"codename": "view_processelement" "codename": "view_processelement"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 166, "pk": 162,
"fields": { "fields": {
"name": "Can add repository", "name": "Can add repository",
"content_type": 43, "content_type": 42,
"codename": "add_repository" "codename": "add_repository"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 167, "pk": 163,
"fields": { "fields": {
"name": "Can change repository", "name": "Can change repository",
"content_type": 43, "content_type": 42,
"codename": "change_repository" "codename": "change_repository"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 168, "pk": 164,
"fields": { "fields": {
"name": "Can delete repository", "name": "Can delete repository",
"content_type": 43, "content_type": 42,
"codename": "delete_repository" "codename": "delete_repository"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 169, "pk": 165,
"fields": { "fields": {
"name": "Can view repository", "name": "Can view repository",
"content_type": 43, "content_type": 42,
"codename": "view_repository" "codename": "view_repository"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 170, "pk": 166,
"fields": { "fields": {
"name": "Can add revision", "name": "Can add revision",
"content_type": 44, "content_type": 43,
"codename": "add_revision" "codename": "add_revision"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 171, "pk": 167,
"fields": { "fields": {
"name": "Can change revision", "name": "Can change revision",
"content_type": 44, "content_type": 43,
"codename": "change_revision" "codename": "change_revision"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 172, "pk": 168,
"fields": { "fields": {
"name": "Can delete revision", "name": "Can delete revision",
"content_type": 44, "content_type": 43,
"codename": "delete_revision" "codename": "delete_revision"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 173, "pk": 169,
"fields": { "fields": {
"name": "Can view revision", "name": "Can view revision",
"content_type": 44, "content_type": 43,
"codename": "view_revision" "codename": "view_revision"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 174, "pk": 170,
"fields": { "fields": {
"name": "Can add worker", "name": "Can add worker",
"content_type": 45, "content_type": 44,
"codename": "add_worker" "codename": "add_worker"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 175, "pk": 171,
"fields": { "fields": {
"name": "Can change worker", "name": "Can change worker",
"content_type": 45, "content_type": 44,
"codename": "change_worker" "codename": "change_worker"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 176, "pk": 172,
"fields": { "fields": {
"name": "Can delete worker", "name": "Can delete worker",
"content_type": 45, "content_type": 44,
"codename": "delete_worker" "codename": "delete_worker"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 177, "pk": 173,
"fields": { "fields": {
"name": "Can view worker", "name": "Can view worker",
"content_type": 45, "content_type": 44,
"codename": "view_worker" "codename": "view_worker"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 178, "pk": 174,
"fields": { "fields": {
"name": "Can add worker activity", "name": "Can add worker activity",
"content_type": 46, "content_type": 45,
"codename": "add_workeractivity" "codename": "add_workeractivity"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 179, "pk": 175,
"fields": { "fields": {
"name": "Can change worker activity", "name": "Can change worker activity",
"content_type": 46, "content_type": 45,
"codename": "change_workeractivity" "codename": "change_workeractivity"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 180, "pk": 176,
"fields": { "fields": {
"name": "Can delete worker activity", "name": "Can delete worker activity",
"content_type": 46, "content_type": 45,
"codename": "delete_workeractivity" "codename": "delete_workeractivity"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 181, "pk": 177,
"fields": { "fields": {
"name": "Can view worker activity", "name": "Can view worker activity",
"content_type": 46, "content_type": 45,
"codename": "view_workeractivity" "codename": "view_workeractivity"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 182, "pk": 178,
"fields": { "fields": {
"name": "Can add worker configuration", "name": "Can add worker configuration",
"content_type": 47, "content_type": 46,
"codename": "add_workerconfiguration" "codename": "add_workerconfiguration"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 183, "pk": 179,
"fields": { "fields": {
"name": "Can change worker configuration", "name": "Can change worker configuration",
"content_type": 47, "content_type": 46,
"codename": "change_workerconfiguration" "codename": "change_workerconfiguration"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 184, "pk": 180,
"fields": { "fields": {
"name": "Can delete worker configuration", "name": "Can delete worker configuration",
"content_type": 47, "content_type": 46,
"codename": "delete_workerconfiguration" "codename": "delete_workerconfiguration"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 185, "pk": 181,
"fields": { "fields": {
"name": "Can view worker configuration", "name": "Can view worker configuration",
"content_type": 47, "content_type": 46,
"codename": "view_workerconfiguration" "codename": "view_workerconfiguration"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 186, "pk": 182,
"fields": { "fields": {
"name": "Can add worker type", "name": "Can add worker type",
"content_type": 48, "content_type": 47,
"codename": "add_workertype" "codename": "add_workertype"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 187, "pk": 183,
"fields": { "fields": {
"name": "Can change worker type", "name": "Can change worker type",
"content_type": 48, "content_type": 47,
"codename": "change_workertype" "codename": "change_workertype"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 188, "pk": 184,
"fields": { "fields": {
"name": "Can delete worker type", "name": "Can delete worker type",
"content_type": 48, "content_type": 47,
"codename": "delete_workertype" "codename": "delete_workertype"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 189, "pk": 185,
"fields": { "fields": {
"name": "Can view worker type", "name": "Can view worker type",
"content_type": 48, "content_type": 47,
"codename": "view_workertype" "codename": "view_workertype"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 190, "pk": 186,
"fields": { "fields": {
"name": "Can add worker version", "name": "Can add worker version",
"content_type": 49, "content_type": 48,
"codename": "add_workerversion" "codename": "add_workerversion"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 191, "pk": 187,
"fields": { "fields": {
"name": "Can change worker version", "name": "Can change worker version",
"content_type": 49, "content_type": 48,
"codename": "change_workerversion" "codename": "change_workerversion"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 192, "pk": 188,
"fields": { "fields": {
"name": "Can delete worker version", "name": "Can delete worker version",
"content_type": 49, "content_type": 48,
"codename": "delete_workerversion" "codename": "delete_workerversion"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 193, "pk": 189,
"fields": { "fields": {
"name": "Can view worker version", "name": "Can view worker version",
"content_type": 49, "content_type": 48,
"codename": "view_workerversion" "codename": "view_workerversion"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 194, "pk": 190,
"fields": { "fields": {
"name": "Can add worker run", "name": "Can add worker run",
"content_type": 50, "content_type": 49,
"codename": "add_workerrun" "codename": "add_workerrun"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 195, "pk": 191,
"fields": { "fields": {
"name": "Can change worker run", "name": "Can change worker run",
"content_type": 50, "content_type": 49,
"codename": "change_workerrun" "codename": "change_workerrun"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 196, "pk": 192,
"fields": { "fields": {
"name": "Can delete worker run", "name": "Can delete worker run",
"content_type": 50, "content_type": 49,
"codename": "delete_workerrun" "codename": "delete_workerrun"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 197, "pk": 193,
"fields": { "fields": {
"name": "Can view worker run", "name": "Can view worker run",
"content_type": 50, "content_type": 49,
"codename": "view_workerrun" "codename": "view_workerrun"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 198, "pk": 194,
"fields": { "fields": {
"name": "Can add process dataset", "name": "Can add process dataset",
"content_type": 51, "content_type": 50,
"codename": "add_processdataset" "codename": "add_processdataset"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 199, "pk": 195,
"fields": { "fields": {
"name": "Can change process dataset", "name": "Can change process dataset",
"content_type": 51, "content_type": 50,
"codename": "change_processdataset" "codename": "change_processdataset"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 200, "pk": 196,
"fields": { "fields": {
"name": "Can delete process dataset", "name": "Can delete process dataset",
"content_type": 51, "content_type": 50,
"codename": "delete_processdataset" "codename": "delete_processdataset"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 201, "pk": 197,
"fields": { "fields": {
"name": "Can view process dataset", "name": "Can view process dataset",
"content_type": 51, "content_type": 50,
"codename": "view_processdataset" "codename": "view_processdataset"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 202, "pk": 198,
"fields": { "fields": {
"name": "Can add dataset", "name": "Can add dataset",
"content_type": 52, "content_type": 51,
"codename": "add_dataset" "codename": "add_dataset"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 203, "pk": 199,
"fields": { "fields": {
"name": "Can change dataset", "name": "Can change dataset",
"content_type": 52, "content_type": 51,
"codename": "change_dataset" "codename": "change_dataset"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 204, "pk": 200,
"fields": { "fields": {
"name": "Can delete dataset", "name": "Can delete dataset",
"content_type": 52, "content_type": 51,
"codename": "delete_dataset" "codename": "delete_dataset"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 205, "pk": 201,
"fields": { "fields": {
"name": "Can view dataset", "name": "Can view dataset",
"content_type": 52, "content_type": 51,
"codename": "view_dataset" "codename": "view_dataset"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 206, "pk": 202,
"fields": { "fields": {
"name": "Can add metric key", "name": "Can add metric key",
"content_type": 53, "content_type": 52,
"codename": "add_metrickey" "codename": "add_metrickey"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 207, "pk": 203,
"fields": { "fields": {
"name": "Can change metric key", "name": "Can change metric key",
"content_type": 53, "content_type": 52,
"codename": "change_metrickey" "codename": "change_metrickey"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 208, "pk": 204,
"fields": { "fields": {
"name": "Can delete metric key", "name": "Can delete metric key",
"content_type": 53, "content_type": 52,
"codename": "delete_metrickey" "codename": "delete_metrickey"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 209, "pk": 205,
"fields": { "fields": {
"name": "Can view metric key", "name": "Can view metric key",
"content_type": 53, "content_type": 52,
"codename": "view_metrickey" "codename": "view_metrickey"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 210, "pk": 206,
"fields": { "fields": {
"name": "Can add model", "name": "Can add model",
"content_type": 54, "content_type": 53,
"codename": "add_model" "codename": "add_model"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 211, "pk": 207,
"fields": { "fields": {
"name": "Can change model", "name": "Can change model",
"content_type": 54, "content_type": 53,
"codename": "change_model" "codename": "change_model"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 212, "pk": 208,
"fields": { "fields": {
"name": "Can delete model", "name": "Can delete model",
"content_type": 54, "content_type": 53,
"codename": "delete_model" "codename": "delete_model"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 213, "pk": 209,
"fields": { "fields": {
"name": "Can view model", "name": "Can view model",
"content_type": 54, "content_type": 53,
"codename": "view_model" "codename": "view_model"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 214, "pk": 210,
"fields": { "fields": {
"name": "Can add model version", "name": "Can add model version",
"content_type": 55, "content_type": 54,
"codename": "add_modelversion" "codename": "add_modelversion"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 215, "pk": 211,
"fields": { "fields": {
"name": "Can change model version", "name": "Can change model version",
"content_type": 55, "content_type": 54,
"codename": "change_modelversion" "codename": "change_modelversion"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 216, "pk": 212,
"fields": { "fields": {
"name": "Can delete model version", "name": "Can delete model version",
"content_type": 55, "content_type": 54,
"codename": "delete_modelversion" "codename": "delete_modelversion"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 217, "pk": 213,
"fields": { "fields": {
"name": "Can view model version", "name": "Can view model version",
"content_type": 55, "content_type": 54,
"codename": "view_modelversion" "codename": "view_modelversion"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 218, "pk": 214,
"fields": { "fields": {
"name": "Can add metric value", "name": "Can add metric value",
"content_type": 56, "content_type": 55,
"codename": "add_metricvalue" "codename": "add_metricvalue"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 219, "pk": 215,
"fields": { "fields": {
"name": "Can change metric value", "name": "Can change metric value",
"content_type": 56, "content_type": 55,
"codename": "change_metricvalue" "codename": "change_metricvalue"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 220, "pk": 216,
"fields": { "fields": {
"name": "Can delete metric value", "name": "Can delete metric value",
"content_type": 56, "content_type": 55,
"codename": "delete_metricvalue" "codename": "delete_metricvalue"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 221, "pk": 217,
"fields": { "fields": {
"name": "Can view metric value", "name": "Can view metric value",
"content_type": 56, "content_type": 55,
"codename": "view_metricvalue" "codename": "view_metricvalue"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 222, "pk": 218,
"fields": { "fields": {
"name": "Can add dataset element", "name": "Can add dataset element",
"content_type": 57, "content_type": 56,
"codename": "add_datasetelement" "codename": "add_datasetelement"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 223, "pk": 219,
"fields": { "fields": {
"name": "Can change dataset element", "name": "Can change dataset element",
"content_type": 57, "content_type": 56,
"codename": "change_datasetelement" "codename": "change_datasetelement"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 224, "pk": 220,
"fields": { "fields": {
"name": "Can delete dataset element", "name": "Can delete dataset element",
"content_type": 57, "content_type": 56,
"codename": "delete_datasetelement" "codename": "delete_datasetelement"
} }
}, },
{ {
"model": "auth.permission", "model": "auth.permission",
"pk": 225, "pk": 221,
"fields": { "fields": {
"name": "Can view dataset element", "name": "Can view dataset element",
"content_type": 57, "content_type": 56,
"codename": "view_datasetelement" "codename": "view_datasetelement"
} }
}, },
{ {
"model": "ponos.farm", "model": "ponos.farm",
"pk": "c19116b6-866f-4bb7-b447-3544629a8151", "pk": "94055f35-9ac9-44a0-ac5d-386e132bea2c",
"fields": { "fields": {
"name": "Wheat farm", "name": "Wheat farm",
"seed": "03f762b3c505f0406a411b3fb3bbe4785c0e7763a05b515e7208b99ee93e955c" "seed": "8cb2c985dcb2dcd344db193307b9049c1fe54d26faba25b417acbb2cdfcc9f41"
} }
}, },
{ {
"model": "ponos.task", "model": "ponos.task",
"pk": "4ca6c03f-9fee-4d44-8b6d-a3cfa5ae1ffb", "pk": "1cb97d66-b673-4068-9824-ab8c33fdcb95",
"fields": { "fields": {
"run": 0, "run": 0,
"depth": 0, "depth": 0,
...@@ -3967,22 +3931,22 @@ ...@@ -3967,22 +3931,22 @@
"agent": null, "agent": null,
"requires_gpu": false, "requires_gpu": false,
"gpu": null, "gpu": null,
"process": "245bc206-350c-43d5-8db3-d98645c4eaa9", "process": "3421ba72-b14c-4df0-a504-1e7e90abe4b4",
"worker_run": null, "worker_run": null,
"container": null, "container": null,
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"expiry": "2100-12-31T23:59:59.999Z", "expiry": "2100-12-31T23:59:59.999Z",
"extra_files": "{}", "extra_files": "{}",
"token": "xm8g6R1OTqmlJVsQwA9aYZfHNbR2Q0fWmB1BRSy4plw=", "token": "/Mp4N1XhQsWzkPneokooyFdtnCiW4EeQi09Z6nn5LUo=",
"parents": [] "parents": []
} }
}, },
{ {
"model": "ponos.artifact", "model": "ponos.artifact",
"pk": "9a1b1d5d-ec3d-4a21-89da-0e930292467d", "pk": "492ea45f-2c2d-4bf3-a461-016204fcfb03",
"fields": { "fields": {
"task": "4ca6c03f-9fee-4d44-8b6d-a3cfa5ae1ffb", "task": "1cb97d66-b673-4068-9824-ab8c33fdcb95",
"path": "/path/to/docker_build", "path": "/path/to/docker_build",
"size": 42000, "size": 42000,
"content_type": "application/octet-stream", "content_type": "application/octet-stream",
...@@ -3992,11 +3956,11 @@ ...@@ -3992,11 +3956,11 @@
}, },
{ {
"model": "training.dataset", "model": "training.dataset",
"pk": "3c74b8de-7c42-4f2a-921f-a5ef957b80da", "pk": "5fb84be2-a906-4bc0-830b-f3a369021a32",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"creator": 2, "creator": 2,
"task": null, "task": null,
"name": "Second Dataset", "name": "Second Dataset",
...@@ -4007,11 +3971,11 @@ ...@@ -4007,11 +3971,11 @@
}, },
{ {
"model": "training.dataset", "model": "training.dataset",
"pk": "87c1ca55-bb92-4b6d-90af-a2f50ae49df9", "pk": "cd5bcbb9-450f-4bdf-9bfc-9640194c2f88",
"fields": { "fields": {
"created": "2020-02-02T01:23:45.678Z", "created": "2020-02-02T01:23:45.678Z",
"updated": "2020-02-02T01:23:45.678Z", "updated": "2020-02-02T01:23:45.678Z",
"corpus": "fdbe4b5c-9475-4310-8877-eb07344e294a", "corpus": "1204ee59-2b68-4dfb-a083-3df4996c2337",
"creator": 2, "creator": 2,
"task": null, "task": null,
"name": "First Dataset", "name": "First Dataset",
......
...@@ -104,6 +104,7 @@ def element_trash(queryset: ElementQuerySet, delete_children: bool) -> None: ...@@ -104,6 +104,7 @@ def element_trash(queryset: ElementQuerySet, delete_children: bool) -> None:
@job("high", timeout=settings.RQ_TIMEOUTS["worker_results_delete"]) @job("high", timeout=settings.RQ_TIMEOUTS["worker_results_delete"])
def selection_worker_results_delete( def selection_worker_results_delete(
corpus_id: str, corpus_id: str,
worker_run_id: Optional[str] = None,
model_version_id: Optional[str] = None, model_version_id: Optional[str] = None,
configuration_id: Optional[str | Literal[False]] = None, configuration_id: Optional[str | Literal[False]] = None,
version_id: Optional[str] = None, version_id: Optional[str] = None,
...@@ -123,6 +124,7 @@ def selection_worker_results_delete( ...@@ -123,6 +124,7 @@ def selection_worker_results_delete(
worker_results_delete( worker_results_delete(
corpus_id=corpus_id, corpus_id=corpus_id,
element_id=element_id, element_id=element_id,
worker_run_id=worker_run_id,
version_id=version_id, version_id=version_id,
model_version_id=model_version_id, model_version_id=model_version_id,
configuration_id=configuration_id, configuration_id=configuration_id,
...@@ -132,6 +134,7 @@ def selection_worker_results_delete( ...@@ -132,6 +134,7 @@ def selection_worker_results_delete(
@job("high", timeout=settings.RQ_TIMEOUTS["worker_results_delete"]) @job("high", timeout=settings.RQ_TIMEOUTS["worker_results_delete"])
def worker_results_delete( def worker_results_delete(
corpus_id: str, corpus_id: str,
worker_run_id: Optional[str] = None,
version_id: Optional[str] = None, version_id: Optional[str] = None,
element_id: Optional[str] = None, element_id: Optional[str] = None,
model_version_id: Optional[str] = None, model_version_id: Optional[str] = None,
...@@ -142,6 +145,8 @@ def worker_results_delete( ...@@ -142,6 +145,8 @@ def worker_results_delete(
whole corpus, under a specified parent element (parent element included), or on a single element. whole corpus, under a specified parent element (parent element included), or on a single element.
Results can be filtered depending on a specific model version and a specific or unset configuration. Results can be filtered depending on a specific model version and a specific or unset configuration.
""" """
assert (not worker_run_id or not version_id), "The worker_run_id and version_id parameters are mutually exclusive."
elements = Element.objects.filter(corpus_id=corpus_id) elements = Element.objects.filter(corpus_id=corpus_id)
classifications = Classification.objects.filter(element__corpus_id=corpus_id) classifications = Classification.objects.filter(element__corpus_id=corpus_id)
transcriptions = Transcription.objects.filter(element__corpus_id=corpus_id) transcriptions = Transcription.objects.filter(element__corpus_id=corpus_id)
...@@ -155,8 +160,19 @@ def worker_results_delete( ...@@ -155,8 +160,19 @@ def worker_results_delete(
metadata = MetaData.objects.filter(element__corpus_id=corpus_id) metadata = MetaData.objects.filter(element__corpus_id=corpus_id)
worker_activities = WorkerActivity.objects.filter(element__corpus_id=corpus_id) worker_activities = WorkerActivity.objects.filter(element__corpus_id=corpus_id)
# When a worker run ID is defined, filter by that worker run ID
if worker_run_id:
elements = elements.filter(worker_run_id=worker_run_id)
classifications = classifications.filter(worker_run_id=worker_run_id)
transcriptions = transcriptions.filter(worker_run_id=worker_run_id)
transcription_entities = transcription_entities.filter(transcription__worker_run_id=worker_run_id)
worker_transcription_entities = worker_transcription_entities.filter(worker_run_id=worker_run_id)
metadata = metadata.filter(worker_run_id=worker_run_id)
# There is no worker_run_id on Worker Activities so the best thing we can do is delete the worker activities
# attached to the elements produced with that worker run, and they are already being deleted by elements.trash()
worker_activities = worker_activities.none()
# When a version ID is defined, filter by the exact version ID # When a version ID is defined, filter by the exact version ID
if version_id: elif version_id:
elements = elements.filter(worker_version_id=version_id) elements = elements.filter(worker_version_id=version_id)
classifications = classifications.filter(worker_version_id=version_id) classifications = classifications.filter(worker_version_id=version_id)
transcriptions = transcriptions.filter(worker_version_id=version_id) transcriptions = transcriptions.filter(worker_version_id=version_id)
...@@ -164,9 +180,12 @@ def worker_results_delete( ...@@ -164,9 +180,12 @@ def worker_results_delete(
worker_transcription_entities = worker_transcription_entities.filter(worker_version_id=version_id) worker_transcription_entities = worker_transcription_entities.filter(worker_version_id=version_id)
metadata = metadata.filter(worker_version_id=version_id) metadata = metadata.filter(worker_version_id=version_id)
worker_activities = worker_activities.filter(worker_version_id=version_id) worker_activities = worker_activities.filter(worker_version_id=version_id)
# Otherwise, select everything that has any worker version ID. # Otherwise, select everything that has any worker version ID. (When something has been created
# by a worker run, it always has a worker version; however we have things that were created with
# a worker version but without a worker run.)
# We use worker_version_id != None and not worker_version_id__isnull=False, # We use worker_version_id != None and not worker_version_id__isnull=False,
# because isnull would cause an unnecessary LEFT JOIN query. # because isnull would cause an unnecessary LEFT JOIN query.
# No extra filtering is needed on worker activities, since worker versions cannot be null there.
else: else:
elements = elements.exclude(worker_version_id=None) elements = elements.exclude(worker_version_id=None)
classifications = classifications.exclude(worker_version_id=None) classifications = classifications.exclude(worker_version_id=None)
...@@ -174,7 +193,6 @@ def worker_results_delete( ...@@ -174,7 +193,6 @@ def worker_results_delete(
transcription_entities = transcription_entities.exclude(transcription__worker_version_id=None) transcription_entities = transcription_entities.exclude(transcription__worker_version_id=None)
worker_transcription_entities = worker_transcription_entities.exclude(worker_version_id=None) worker_transcription_entities = worker_transcription_entities.exclude(worker_version_id=None)
metadata = metadata.exclude(worker_version_id=None) metadata = metadata.exclude(worker_version_id=None)
worker_activities = worker_activities.exclude(worker_version_id=None)
if element_id: if element_id:
# include_children causes a deletion *only* on the element's descendants. # include_children causes a deletion *only* on the element's descendants.
...@@ -202,17 +220,16 @@ def worker_results_delete( ...@@ -202,17 +220,16 @@ def worker_results_delete(
metadata = metadata.filter(element_id=element_id) metadata = metadata.filter(element_id=element_id)
worker_activities = worker_activities.filter(element_id=element_id) worker_activities = worker_activities.filter(element_id=element_id)
if model_version_id: if not worker_run_id and model_version_id:
elements = elements.filter(worker_run__model_version_id=model_version_id) elements = elements.filter(worker_run__model_version_id=model_version_id)
classifications = classifications.filter(worker_run__model_version_id=model_version_id) classifications = classifications.filter(worker_run__model_version_id=model_version_id)
transcriptions = transcriptions.filter(worker_run__model_version_id=model_version_id) transcriptions = transcriptions.filter(worker_run__model_version_id=model_version_id)
transcription_entities = transcription_entities.filter(transcription__worker_run__model_version_id=model_version_id) transcription_entities = transcription_entities.filter(transcription__worker_run__model_version_id=model_version_id)
worker_transcription_entities = worker_transcription_entities.filter(worker_run__model_version_id=model_version_id) worker_transcription_entities = worker_transcription_entities.filter(worker_run__model_version_id=model_version_id)
metadata = metadata.filter(worker_run__model_version_id=model_version_id) metadata = metadata.filter(worker_run__model_version_id=model_version_id)
# Activities are not linked to a worker run and cannot be filtered by model version worker_activities = worker_activities.filter(model_version_id=model_version_id)
worker_activities = worker_activities.none()
if configuration_id is not None: if not worker_run_id and configuration_id is not None:
if configuration_id is False: if configuration_id is False:
# Only delete results generated on a worker run with no configuration # Only delete results generated on a worker run with no configuration
elements = elements.filter(worker_run__configuration_id=None) elements = elements.filter(worker_run__configuration_id=None)
...@@ -247,6 +264,7 @@ def worker_results_delete( ...@@ -247,6 +264,7 @@ def worker_results_delete(
# we were supposed to delete worker results on. # we were supposed to delete worker results on.
worker_results_delete( worker_results_delete(
corpus_id=corpus_id, corpus_id=corpus_id,
worker_run_id=worker_run_id,
version_id=version_id, version_id=version_id,
element_id=element_id, element_id=element_id,
model_version_id=model_version_id, model_version_id=model_version_id,
......
...@@ -3,7 +3,7 @@ from django.db.models.signals import pre_delete ...@@ -3,7 +3,7 @@ from django.db.models.signals import pre_delete
from arkindex.documents.models import Corpus, Element, EntityType, MetaType, Transcription from arkindex.documents.models import Corpus, Element, EntityType, MetaType, Transcription
from arkindex.documents.tasks import corpus_delete from arkindex.documents.tasks import corpus_delete
from arkindex.ponos.models import Farm, State, Task from arkindex.ponos.models import Farm, State, Task
from arkindex.process.models import CorpusWorkerVersion, ProcessMode, Repository, WorkerVersion from arkindex.process.models import CorpusWorkerVersion, ProcessDataset, ProcessMode, Repository, WorkerVersion
from arkindex.project.tests import FixtureTestCase, force_constraints_immediate from arkindex.project.tests import FixtureTestCase, force_constraints_immediate
from arkindex.training.models import Dataset from arkindex.training.models import Dataset
...@@ -118,13 +118,14 @@ class TestDeleteCorpus(FixtureTestCase): ...@@ -118,13 +118,14 @@ class TestDeleteCorpus(FixtureTestCase):
cls.dataset2 = Dataset.objects.create(name="Dead Sea Scrolls", description="How to trigger a Third Impact", creator=cls.user, corpus=cls.corpus2) cls.dataset2 = Dataset.objects.create(name="Dead Sea Scrolls", description="How to trigger a Third Impact", creator=cls.user, corpus=cls.corpus2)
# Process on cls.corpus and with a dataset from cls.corpus # Process on cls.corpus and with a dataset from cls.corpus
dataset_process1 = cls.corpus.processes.create(creator=cls.user, mode=ProcessMode.Dataset) dataset_process1 = cls.corpus.processes.create(creator=cls.user, mode=ProcessMode.Dataset)
dataset_process1.datasets.set([dataset1]) ProcessDataset.objects.create(process=dataset_process1, dataset=dataset1, sets=dataset1.sets)
# Process on cls.corpus with a dataset from another corpus # Process on cls.corpus with a dataset from another corpus
dataset_process2 = cls.corpus.processes.create(creator=cls.user, mode=ProcessMode.Dataset) dataset_process2 = cls.corpus.processes.create(creator=cls.user, mode=ProcessMode.Dataset)
dataset_process2.datasets.set([dataset1, cls.dataset2]) ProcessDataset.objects.create(process=dataset_process2, dataset=dataset1, sets=dataset1.sets)
ProcessDataset.objects.create(process=dataset_process2, dataset=cls.dataset2, sets=cls.dataset2.sets)
# Process on another corpus with a dataset from another corpus and none from cls.corpus # Process on another corpus with a dataset from another corpus and none from cls.corpus
cls.dataset_process2 = cls.corpus2.processes.create(creator=cls.user, mode=ProcessMode.Dataset) cls.dataset_process3 = cls.corpus2.processes.create(creator=cls.user, mode=ProcessMode.Dataset)
cls.dataset_process2.datasets.set([cls.dataset2]) ProcessDataset.objects.create(process=cls.dataset_process3, dataset=cls.dataset2, sets=cls.dataset2.sets)
cls.rev = cls.repo.revisions.create( cls.rev = cls.repo.revisions.create(
hash="42", hash="42",
...@@ -200,14 +201,14 @@ class TestDeleteCorpus(FixtureTestCase): ...@@ -200,14 +201,14 @@ class TestDeleteCorpus(FixtureTestCase):
self.df.refresh_from_db() self.df.refresh_from_db()
self.vol.refresh_from_db() self.vol.refresh_from_db()
self.page.refresh_from_db() self.page.refresh_from_db()
self.dataset_process2.refresh_from_db() self.dataset_process3.refresh_from_db()
self.assertTrue(self.repo.revisions.filter(id=self.rev.id).exists()) self.assertTrue(self.repo.revisions.filter(id=self.rev.id).exists())
self.assertEqual(self.process.revision, self.rev) self.assertEqual(self.process.revision, self.rev)
self.assertEqual(self.process.files.get(), self.df) self.assertEqual(self.process.files.get(), self.df)
self.assertTrue(Element.objects.get_descending(self.vol.id).filter(id=self.page.id).exists()) self.assertTrue(Element.objects.get_descending(self.vol.id).filter(id=self.page.id).exists())
self.assertTrue(self.corpus2.datasets.filter(id=self.dataset2.id).exists()) self.assertTrue(self.corpus2.datasets.filter(id=self.dataset2.id).exists())
self.assertTrue(self.corpus2.processes.filter(id=self.dataset_process2.id).exists()) self.assertTrue(self.corpus2.processes.filter(id=self.dataset_process3.id).exists())
md = self.vol.metadatas.get() md = self.vol.metadatas.get()
self.assertEqual(md.name, "meta") self.assertEqual(md.name, "meta")
......
...@@ -4,7 +4,7 @@ from django.db import connections ...@@ -4,7 +4,7 @@ from django.db import connections
from django.db.utils import IntegrityError from django.db.utils import IntegrityError
from arkindex.documents.tasks import selection_worker_results_delete from arkindex.documents.tasks import selection_worker_results_delete
from arkindex.process.models import Worker, WorkerVersion from arkindex.process.models import Worker, WorkerRun, WorkerVersion
from arkindex.project.tests import FixtureTestCase from arkindex.project.tests import FixtureTestCase
from arkindex.training.models import Dataset, Model, ModelVersionState from arkindex.training.models import Dataset, Model, ModelVersionState
...@@ -18,6 +18,7 @@ class TestDeleteSelectionWorkerResults(FixtureTestCase): ...@@ -18,6 +18,7 @@ class TestDeleteSelectionWorkerResults(FixtureTestCase):
cls.page2 = cls.corpus.elements.get(name="Volume 1, page 1v") cls.page2 = cls.corpus.elements.get(name="Volume 1, page 1v")
cls.page3 = cls.corpus.elements.get(name="Volume 1, page 2r") cls.page3 = cls.corpus.elements.get(name="Volume 1, page 2r")
cls.version = WorkerVersion.objects.first() cls.version = WorkerVersion.objects.first()
cls.worker_run = WorkerRun.objects.first()
cls.model = Model.objects.create(name="Generic model", public=False) cls.model = Model.objects.create(name="Generic model", public=False)
cls.model_version = cls.model.versions.create( cls.model_version = cls.model.versions.create(
state=ModelVersionState.Available, state=ModelVersionState.Available,
...@@ -63,6 +64,7 @@ class TestDeleteSelectionWorkerResults(FixtureTestCase): ...@@ -63,6 +64,7 @@ class TestDeleteSelectionWorkerResults(FixtureTestCase):
self.assertCountEqual(worker_results_delete_mock.call_args_list, [ self.assertCountEqual(worker_results_delete_mock.call_args_list, [
call( call(
corpus_id=self.corpus.id, corpus_id=self.corpus.id,
worker_run_id=None,
version_id=None, version_id=None,
model_version_id=None, model_version_id=None,
configuration_id=None, configuration_id=None,
...@@ -70,6 +72,7 @@ class TestDeleteSelectionWorkerResults(FixtureTestCase): ...@@ -70,6 +72,7 @@ class TestDeleteSelectionWorkerResults(FixtureTestCase):
), ),
call( call(
corpus_id=self.corpus.id, corpus_id=self.corpus.id,
worker_run_id=None,
version_id=None, version_id=None,
model_version_id=None, model_version_id=None,
configuration_id=None, configuration_id=None,
...@@ -102,6 +105,7 @@ class TestDeleteSelectionWorkerResults(FixtureTestCase): ...@@ -102,6 +105,7 @@ class TestDeleteSelectionWorkerResults(FixtureTestCase):
self.assertCountEqual(worker_results_delete_mock.call_args_list, [ self.assertCountEqual(worker_results_delete_mock.call_args_list, [
call( call(
corpus_id=self.corpus.id, corpus_id=self.corpus.id,
worker_run_id=None,
version_id=self.version.id, version_id=self.version.id,
model_version_id=self.model_version.id, model_version_id=self.model_version.id,
configuration_id=self.configuration.id, configuration_id=self.configuration.id,
...@@ -109,6 +113,7 @@ class TestDeleteSelectionWorkerResults(FixtureTestCase): ...@@ -109,6 +113,7 @@ class TestDeleteSelectionWorkerResults(FixtureTestCase):
), ),
call( call(
corpus_id=self.corpus.id, corpus_id=self.corpus.id,
worker_run_id=None,
version_id=self.version.id, version_id=self.version.id,
model_version_id=self.model_version.id, model_version_id=self.model_version.id,
configuration_id=self.configuration.id, configuration_id=self.configuration.id,
...@@ -116,6 +121,60 @@ class TestDeleteSelectionWorkerResults(FixtureTestCase): ...@@ -116,6 +121,60 @@ class TestDeleteSelectionWorkerResults(FixtureTestCase):
), ),
]) ])
@patch("arkindex.documents.tasks.get_current_job")
def test_run_worker_run_or_version(self, job_mock):
self.user.selected_elements.set([self.page1, self.page2])
self.superuser.selected_elements.set([self.page3])
job_mock.return_value.user_id = self.user.id
with self.assertRaisesMessage(AssertionError, "The worker_run_id and version_id parameters are mutually exclusive."):
selection_worker_results_delete(
corpus_id=self.corpus.id,
worker_run_id=self.worker_run.id,
version_id=self.version.id,
model_version_id=self.model_version.id,
configuration_id=self.configuration.id,
)
@patch("arkindex.documents.tasks.get_current_job")
@patch("arkindex.documents.tasks.worker_results_delete")
def test_run_worker_run_filter(self, worker_results_delete_mock, job_mock):
self.user.selected_elements.set([self.page1, self.page2])
self.superuser.selected_elements.set([self.page3])
job_mock.return_value.user_id = self.user.id
selection_worker_results_delete(
corpus_id=self.corpus.id,
worker_run_id=self.worker_run.id
)
self.assertEqual(job_mock.call_count, 1)
self.assertEqual(job_mock().set_progress.call_count, 2)
self.assertListEqual(job_mock().set_progress.call_args_list, [
call(.0),
call(.5),
])
self.assertEqual(worker_results_delete_mock.call_count, 2)
self.assertCountEqual(worker_results_delete_mock.call_args_list, [
call(
corpus_id=self.corpus.id,
worker_run_id=self.worker_run.id,
version_id=None,
model_version_id=None,
configuration_id=None,
element_id=self.page1.id,
),
call(
corpus_id=self.corpus.id,
worker_run_id=self.worker_run.id,
version_id=None,
model_version_id=None,
configuration_id=None,
element_id=self.page2.id,
),
])
@patch("arkindex.documents.tasks.get_current_job") @patch("arkindex.documents.tasks.get_current_job")
def test_run_dataset_failure(self, job_mock): def test_run_dataset_failure(self, job_mock):
""" """
......
...@@ -157,7 +157,7 @@ class TestDeleteWorkerResults(FixtureTestCase): ...@@ -157,7 +157,7 @@ class TestDeleteWorkerResults(FixtureTestCase):
"version_id": str(self.version_1.id), "version_id": str(self.version_1.id),
"element_id": str(self.page1.id), "element_id": str(self.page1.id),
}): }):
worker_results_delete(self.corpus.id, self.version_1.id, self.page1.id) worker_results_delete(corpus_id=self.corpus.id, version_id=self.version_1.id, element_id=self.page1.id)
self.check_deleted( self.check_deleted(
self.classification2, self.classification2,
self.transcription1, self.transcription1,
...@@ -173,7 +173,7 @@ class TestDeleteWorkerResults(FixtureTestCase): ...@@ -173,7 +173,7 @@ class TestDeleteWorkerResults(FixtureTestCase):
"version_id": str(self.version_1.id), "version_id": str(self.version_1.id),
"element_id": str(self.page2.id), "element_id": str(self.page2.id),
}): }):
worker_results_delete(self.corpus.id, self.version_1.id, self.page2.id) worker_results_delete(corpus_id=self.corpus.id, version_id=self.version_1.id, element_id=self.page2.id)
self.check_deleted( self.check_deleted(
self.classification3, self.classification3,
self.transcription2, self.transcription2,
...@@ -278,3 +278,76 @@ class TestDeleteWorkerResults(FixtureTestCase): ...@@ -278,3 +278,76 @@ class TestDeleteWorkerResults(FixtureTestCase):
# https://code.djangoproject.com/ticket/11665 # https://code.djangoproject.com/ticket/11665
with self.assertRaises(IntegrityError): with self.assertRaises(IntegrityError):
connections["default"].check_constraints() connections["default"].check_constraints()
def test_run_worker_run_or_version(self):
with self.assertRaisesMessage(AssertionError, "The worker_run_id and version_id parameters are mutually exclusive."):
worker_results_delete(
corpus_id=self.corpus.id,
version_id=self.version_1.id,
worker_run_id=self.worker_run_1.id
)
def test_run_worker_run_on_corpus(self):
with self.assertExactQueries("worker_results_delete_in_corpus_worker_run.sql", params={
"corpus_id": str(self.corpus.id),
"worker_run_id": str(self.worker_run_1.id),
}):
worker_results_delete(
corpus_id=self.corpus.id,
worker_run_id=self.worker_run_1.id,
)
self.check_deleted(
self.classification1,
self.classification2,
self.classification3
)
def test_run_worker_run_on_parent(self):
with self.assertExactQueries("worker_results_delete_under_parent_worker_run.sql", params={
"corpus_id": str(self.corpus.id),
"worker_run_id": str(self.worker_run_2.id),
"element_id": str(self.page1.id),
}):
worker_results_delete(corpus_id=self.corpus.id, worker_run_id=self.worker_run_2.id, element_id=self.page1.id)
self.check_deleted(
self.transcription1,
self.transcription_entity1,
)
def test_run_worker_run_on_parent_delete_element(self):
"""
The element itself is deleted after its related results from the same worker run
"""
self.page1.worker_run = self.worker_run_2
self.page1.worker_version = self.version_2
self.page1.save()
with self.assertExactQueries("worker_results_delete_under_parent_included_worker_run.sql", params={
"corpus_id": str(self.corpus.id),
"worker_run_id": str(self.worker_run_2.id),
"element_id": str(self.page1.id),
}):
worker_results_delete(corpus_id=self.corpus.id, worker_run_id=self.worker_run_2.id, element_id=self.page1.id)
self.check_deleted(
self.transcription1,
self.transcription_entity1,
self.page1,
# self.classifications2 is deleted as well since it's on self.page1
self.classification2
)
def test_run_worker_run_ignore_filters(self):
with self.assertExactQueries("worker_results_delete_in_corpus_worker_run.sql", params={
"corpus_id": str(self.corpus.id),
"worker_run_id": str(self.worker_run_1.id)
}):
worker_results_delete(
corpus_id=self.corpus.id,
worker_run_id=self.worker_run_1.id,
model_version_id=self.model_version.id,
configuration_id=self.configuration.id
)
self.check_deleted(
self.classification1,
self.classification2,
self.classification3
)
from unittest.mock import patch
from django.urls import reverse from django.urls import reverse
from rest_framework import status from rest_framework import status
...@@ -51,7 +53,8 @@ class TestAllowedMetaData(FixtureAPITestCase): ...@@ -51,7 +53,8 @@ class TestAllowedMetaData(FixtureAPITestCase):
list(expected_meta[3:]) list(expected_meta[3:])
) )
def test_list_private_corpus(self): @patch("arkindex.project.mixins.has_access", return_value=False)
def test_list_private_corpus(self, has_access_mock):
with self.assertNumQueries(1): with self.assertNumQueries(1):
response = self.client.get( response = self.client.get(
reverse("api:corpus-allowed-metadata", kwargs={"pk": str(self.private_corpus.id)}), reverse("api:corpus-allowed-metadata", kwargs={"pk": str(self.private_corpus.id)}),
...@@ -77,7 +80,7 @@ class TestAllowedMetaData(FixtureAPITestCase): ...@@ -77,7 +80,7 @@ class TestAllowedMetaData(FixtureAPITestCase):
def test_create(self): def test_create(self):
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(8): with self.assertNumQueries(5):
response = self.client.post( response = self.client.post(
reverse("api:corpus-allowed-metadata", kwargs={"pk": str(self.corpus.id)}), reverse("api:corpus-allowed-metadata", kwargs={"pk": str(self.corpus.id)}),
data={"name": "flan", "type": "text"} data={"name": "flan", "type": "text"}
...@@ -93,7 +96,7 @@ class TestAllowedMetaData(FixtureAPITestCase): ...@@ -93,7 +96,7 @@ class TestAllowedMetaData(FixtureAPITestCase):
def test_create_unique(self): def test_create_unique(self):
self.client.force_login(self.user) self.client.force_login(self.user)
self.corpus.allowed_metadatas.create(name="flan", type=MetaType.Text) self.corpus.allowed_metadatas.create(name="flan", type=MetaType.Text)
with self.assertNumQueries(7): with self.assertNumQueries(4):
response = self.client.post( response = self.client.post(
reverse("api:corpus-allowed-metadata", kwargs={"pk": str(self.corpus.id)}), reverse("api:corpus-allowed-metadata", kwargs={"pk": str(self.corpus.id)}),
data={"name": "flan", "type": "text"} data={"name": "flan", "type": "text"}
...@@ -122,21 +125,21 @@ class TestAllowedMetaData(FixtureAPITestCase): ...@@ -122,21 +125,21 @@ class TestAllowedMetaData(FixtureAPITestCase):
) )
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
def test_create_requires_corpus_admin(self): @patch("arkindex.project.mixins.has_access", return_value=False)
def test_create_requires_corpus_admin(self, has_access_mock):
self.client.force_login(self.user) self.client.force_login(self.user)
for role in [Role.Guest, Role.Contributor]: self.corpus.memberships.filter(user=self.user).update(level=Role.Contributor.value)
with self.subTest(role=role): with self.assertNumQueries(3):
self.corpus.memberships.filter(user=self.user).update(level=role.value) response = self.client.post(
with self.assertNumQueries(5): reverse("api:corpus-allowed-metadata", kwargs={"pk": str(self.corpus.id)}),
response = self.client.post( data={"name": "flan", "type": "text"}
reverse("api:corpus-allowed-metadata", kwargs={"pk": str(self.corpus.id)}), )
data={"name": "flan", "type": "text"} self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
)
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) @patch("arkindex.project.mixins.has_access", return_value=False)
def test_create_private_corpus(self, has_access_mock):
def test_create_private_corpus(self):
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(6): with self.assertNumQueries(3):
response = self.client.post( response = self.client.post(
reverse("api:corpus-allowed-metadata", kwargs={"pk": str(self.private_corpus.id)}), reverse("api:corpus-allowed-metadata", kwargs={"pk": str(self.private_corpus.id)}),
data={"name": "flan", "type": "text"} data={"name": "flan", "type": "text"}
...@@ -145,7 +148,7 @@ class TestAllowedMetaData(FixtureAPITestCase): ...@@ -145,7 +148,7 @@ class TestAllowedMetaData(FixtureAPITestCase):
def test_create_invalid(self): def test_create_invalid(self):
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(6): with self.assertNumQueries(3):
response = self.client.post( response = self.client.post(
reverse("api:corpus-allowed-metadata", kwargs={"pk": str(self.corpus.id)}), reverse("api:corpus-allowed-metadata", kwargs={"pk": str(self.corpus.id)}),
data={"name": "flan", "type": "pouet"} data={"name": "flan", "type": "pouet"}
...@@ -175,9 +178,10 @@ class TestAllowedMetaData(FixtureAPITestCase): ...@@ -175,9 +178,10 @@ class TestAllowedMetaData(FixtureAPITestCase):
response = self.client.get(reverse("api:allowed-metadata-edit", kwargs={"corpus": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "pk": self.test_meta.id})) response = self.client.get(reverse("api:allowed-metadata-edit", kwargs={"corpus": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa", "pk": self.test_meta.id}))
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
def test_retrieve_private_corpus(self): @patch("arkindex.project.mixins.has_access", return_value=False)
def test_retrieve_private_corpus(self, has_access_mock):
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(6): with self.assertNumQueries(3):
response = self.client.get(reverse("api:allowed-metadata-edit", kwargs={"corpus": self.private_corpus.id, "pk": self.test_meta.id})) response = self.client.get(reverse("api:allowed-metadata-edit", kwargs={"corpus": self.private_corpus.id, "pk": self.test_meta.id}))
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
...@@ -228,9 +232,10 @@ class TestAllowedMetaData(FixtureAPITestCase): ...@@ -228,9 +232,10 @@ class TestAllowedMetaData(FixtureAPITestCase):
) )
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
def test_update_private_corpus(self): @patch("arkindex.project.mixins.has_access", return_value=False)
def test_update_private_corpus(self, has_access_mock):
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(6): with self.assertNumQueries(3):
response = self.client.put( response = self.client.put(
reverse("api:allowed-metadata-edit", kwargs={"corpus": self.private_corpus.id, "pk": self.test_meta.id}), reverse("api:allowed-metadata-edit", kwargs={"corpus": self.private_corpus.id, "pk": self.test_meta.id}),
{"type": "url", "name": "newName"}, {"type": "url", "name": "newName"},
...@@ -239,7 +244,7 @@ class TestAllowedMetaData(FixtureAPITestCase): ...@@ -239,7 +244,7 @@ class TestAllowedMetaData(FixtureAPITestCase):
def test_update_invalid_type(self): def test_update_invalid_type(self):
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(7): with self.assertNumQueries(4):
response = self.client.put( response = self.client.put(
reverse("api:allowed-metadata-edit", kwargs={"corpus": self.corpus.id, "pk": self.test_meta.id}), reverse("api:allowed-metadata-edit", kwargs={"corpus": self.corpus.id, "pk": self.test_meta.id}),
{"type": "invalidType", "name": "newName"}, {"type": "invalidType", "name": "newName"},
...@@ -251,7 +256,7 @@ class TestAllowedMetaData(FixtureAPITestCase): ...@@ -251,7 +256,7 @@ class TestAllowedMetaData(FixtureAPITestCase):
def test_update_missing_argument(self): def test_update_missing_argument(self):
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(7): with self.assertNumQueries(4):
response = self.client.put( response = self.client.put(
reverse("api:allowed-metadata-edit", kwargs={"corpus": self.corpus.id, "pk": self.test_meta.id}), reverse("api:allowed-metadata-edit", kwargs={"corpus": self.corpus.id, "pk": self.test_meta.id}),
{"name": "newName"}, {"name": "newName"},
...@@ -263,7 +268,7 @@ class TestAllowedMetaData(FixtureAPITestCase): ...@@ -263,7 +268,7 @@ class TestAllowedMetaData(FixtureAPITestCase):
def test_update_duplicate(self): def test_update_duplicate(self):
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(8): with self.assertNumQueries(5):
response = self.client.put( response = self.client.put(
reverse("api:allowed-metadata-edit", kwargs={"corpus": self.corpus.id, "pk": self.test_meta.id}), reverse("api:allowed-metadata-edit", kwargs={"corpus": self.corpus.id, "pk": self.test_meta.id}),
{"type": self.allowed_meta[1].type.value, "name": self.allowed_meta[1].name}, {"type": self.allowed_meta[1].type.value, "name": self.allowed_meta[1].name},
...@@ -273,21 +278,20 @@ class TestAllowedMetaData(FixtureAPITestCase): ...@@ -273,21 +278,20 @@ class TestAllowedMetaData(FixtureAPITestCase):
"detail": ["An AllowedMetaData with this type and name already exists in this corpus."] "detail": ["An AllowedMetaData with this type and name already exists in this corpus."]
}) })
def test_update_requires_corpus_admin(self): @patch("arkindex.project.mixins.has_access", return_value=False)
def test_update_requires_corpus_admin(self, has_access_mock):
self.client.force_login(self.user) self.client.force_login(self.user)
for role in [Role.Guest, Role.Contributor]: self.corpus.memberships.filter(user=self.user).update(level=Role.Contributor.value)
with self.subTest(role=role): with self.assertNumQueries(3):
self.corpus.memberships.filter(user=self.user).update(level=role.value) response = self.client.put(
with self.assertNumQueries(5): reverse("api:allowed-metadata-edit", kwargs={"corpus": self.corpus.id, "pk": self.test_meta.id}),
response = self.client.put( {"type": self.allowed_meta[2].type.value, "name": self.allowed_meta[2].name},
reverse("api:allowed-metadata-edit", kwargs={"corpus": self.corpus.id, "pk": self.test_meta.id}), )
{"type": self.allowed_meta[2].type.value, "name": self.allowed_meta[2].name}, self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
)
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
def test_partial_update(self): def test_partial_update(self):
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(9): with self.assertNumQueries(6):
response = self.client.patch( response = self.client.patch(
reverse("api:allowed-metadata-edit", kwargs={"corpus": self.corpus.id, "pk": self.test_meta.id}), reverse("api:allowed-metadata-edit", kwargs={"corpus": self.corpus.id, "pk": self.test_meta.id}),
{"name": "newName"}, {"name": "newName"},
...@@ -317,9 +321,10 @@ class TestAllowedMetaData(FixtureAPITestCase): ...@@ -317,9 +321,10 @@ class TestAllowedMetaData(FixtureAPITestCase):
{"type": "reference"}) {"type": "reference"})
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
def test_partial_update_private_corpus(self): @patch("arkindex.project.mixins.has_access", return_value=False)
def test_partial_update_private_corpus(self, has_access_mock):
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(6): with self.assertNumQueries(3):
response = self.client.patch( response = self.client.patch(
reverse("api:allowed-metadata-edit", kwargs={"corpus": self.private_corpus.id, "pk": self.test_meta.id}), reverse("api:allowed-metadata-edit", kwargs={"corpus": self.private_corpus.id, "pk": self.test_meta.id}),
{"type": "reference"}) {"type": "reference"})
...@@ -327,7 +332,7 @@ class TestAllowedMetaData(FixtureAPITestCase): ...@@ -327,7 +332,7 @@ class TestAllowedMetaData(FixtureAPITestCase):
def test_partial_update_invalid_type(self): def test_partial_update_invalid_type(self):
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(7): with self.assertNumQueries(4):
response = self.client.patch( response = self.client.patch(
reverse("api:allowed-metadata-edit", kwargs={"corpus": self.corpus.id, "pk": self.test_meta.id}), reverse("api:allowed-metadata-edit", kwargs={"corpus": self.corpus.id, "pk": self.test_meta.id}),
{"type": "invalidType"}, {"type": "invalidType"},
...@@ -339,7 +344,7 @@ class TestAllowedMetaData(FixtureAPITestCase): ...@@ -339,7 +344,7 @@ class TestAllowedMetaData(FixtureAPITestCase):
def test_partial_update_duplicate(self): def test_partial_update_duplicate(self):
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(8): with self.assertNumQueries(5):
response = self.client.patch( response = self.client.patch(
reverse("api:allowed-metadata-edit", kwargs={"corpus": self.corpus.id, "pk": self.test_meta.id}), reverse("api:allowed-metadata-edit", kwargs={"corpus": self.corpus.id, "pk": self.test_meta.id}),
{"type": self.allowed_meta[2].type.value}, {"type": self.allowed_meta[2].type.value},
...@@ -349,21 +354,20 @@ class TestAllowedMetaData(FixtureAPITestCase): ...@@ -349,21 +354,20 @@ class TestAllowedMetaData(FixtureAPITestCase):
"detail": ["An AllowedMetaData with this type and name already exists in this corpus."] "detail": ["An AllowedMetaData with this type and name already exists in this corpus."]
}) })
def test_partial_update_requires_corpus_admin(self): @patch("arkindex.project.mixins.has_access", return_value=False)
def test_partial_update_requires_corpus_admin(self, has_access_mock):
self.client.force_login(self.user) self.client.force_login(self.user)
for role in [Role.Guest, Role.Contributor]: self.corpus.memberships.filter(user=self.user).update(level=Role.Contributor.value)
with self.subTest(role=role): with self.assertNumQueries(3):
self.corpus.memberships.filter(user=self.user).update(level=role.value) response = self.client.patch(
with self.assertNumQueries(5): reverse("api:allowed-metadata-edit", kwargs={"corpus": self.corpus.id, "pk": self.test_meta.id}),
response = self.client.patch( {"type": self.allowed_meta[2].type.value},
reverse("api:allowed-metadata-edit", kwargs={"corpus": self.corpus.id, "pk": self.test_meta.id}), )
{"type": self.allowed_meta[2].type.value}, self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
)
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
def test_destroy(self): def test_destroy(self):
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(8): with self.assertNumQueries(5):
response = self.client.delete(reverse("api:allowed-metadata-edit", kwargs={"corpus": self.corpus.id, "pk": self.test_meta.id})) response = self.client.delete(reverse("api:allowed-metadata-edit", kwargs={"corpus": self.corpus.id, "pk": self.test_meta.id}))
self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT) self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT)
...@@ -372,7 +376,7 @@ class TestAllowedMetaData(FixtureAPITestCase): ...@@ -372,7 +376,7 @@ class TestAllowedMetaData(FixtureAPITestCase):
def test_destroy_not_found(self): def test_destroy_not_found(self):
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(7): with self.assertNumQueries(4):
response = self.client.delete(reverse("api:allowed-metadata-edit", kwargs={"corpus": self.corpus.id, "pk": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"})) response = self.client.delete(reverse("api:allowed-metadata-edit", kwargs={"corpus": self.corpus.id, "pk": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"}))
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
...@@ -395,17 +399,17 @@ class TestAllowedMetaData(FixtureAPITestCase): ...@@ -395,17 +399,17 @@ class TestAllowedMetaData(FixtureAPITestCase):
response = self.client.delete(reverse("api:allowed-metadata-edit", kwargs={"corpus": self.corpus.id, "pk": self.test_meta.id})) response = self.client.delete(reverse("api:allowed-metadata-edit", kwargs={"corpus": self.corpus.id, "pk": self.test_meta.id}))
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
def test_destroy_private_corpus(self): @patch("arkindex.project.mixins.has_access", return_value=False)
def test_destroy_private_corpus(self, has_access_mock):
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(6): with self.assertNumQueries(3):
response = self.client.delete(reverse("api:allowed-metadata-edit", kwargs={"corpus": self.private_corpus.id, "pk": self.test_meta.id})) response = self.client.delete(reverse("api:allowed-metadata-edit", kwargs={"corpus": self.private_corpus.id, "pk": self.test_meta.id}))
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
def test_destroy_requires_corpus_admin(self): @patch("arkindex.project.mixins.has_access", return_value=False)
def test_destroy_requires_corpus_admin(self, has_access_mock):
self.client.force_login(self.user) self.client.force_login(self.user)
for role in [Role.Guest, Role.Contributor]: self.corpus.memberships.filter(user=self.user).update(level=Role.Contributor.value)
with self.subTest(role=role): with self.assertNumQueries(3):
self.corpus.memberships.filter(user=self.user).update(level=role.value) response = self.client.delete(reverse("api:allowed-metadata-edit", kwargs={"corpus": self.corpus.id, "pk": self.test_meta.id}))
with self.assertNumQueries(5): self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
response = self.client.delete(reverse("api:allowed-metadata-edit", kwargs={"corpus": self.corpus.id, "pk": self.test_meta.id}))
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
from unittest.mock import patch
from django.urls import reverse from django.urls import reverse
from rest_framework import status from rest_framework import status
...@@ -24,15 +26,17 @@ class TestBulkClassification(FixtureAPITestCase): ...@@ -24,15 +26,17 @@ class TestBulkClassification(FixtureAPITestCase):
response = self.client.post(reverse("api:classification-bulk"), format="json") response = self.client.post(reverse("api:classification-bulk"), format="json")
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
def test_wrong_acl(self): @patch("arkindex.users.managers.BaseACLManager.filter_rights")
def test_wrong_acl(self, filter_rights_mock):
""" """
The user must have access to the parent element The user must have access to the parent element
""" """
filter_rights_mock.return_value = Corpus.objects.none()
self.client.force_login(self.user) self.client.force_login(self.user)
private_page = self.private_corpus.elements.create( private_page = self.private_corpus.elements.create(
type=self.private_corpus.types.create(slug="page"), type=self.private_corpus.types.create(slug="page"),
) )
with self.assertNumQueries(6): with self.assertNumQueries(3):
response = self.client.post( response = self.client.post(
reverse("api:classification-bulk"), reverse("api:classification-bulk"),
format="json", format="json",
...@@ -61,7 +65,7 @@ class TestBulkClassification(FixtureAPITestCase): ...@@ -61,7 +65,7 @@ class TestBulkClassification(FixtureAPITestCase):
Classifications must be linked to a worker run Classifications must be linked to a worker run
""" """
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(5): with self.assertNumQueries(3):
response = self.client.post( response = self.client.post(
reverse("api:classification-bulk"), reverse("api:classification-bulk"),
format="json", format="json",
...@@ -89,7 +93,7 @@ class TestBulkClassification(FixtureAPITestCase): ...@@ -89,7 +93,7 @@ class TestBulkClassification(FixtureAPITestCase):
def test_worker_run_not_found(self): def test_worker_run_not_found(self):
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(6): with self.assertNumQueries(4):
response = self.client.post( response = self.client.post(
reverse("api:classification-bulk"), reverse("api:classification-bulk"),
format="json", format="json",
...@@ -119,7 +123,7 @@ class TestBulkClassification(FixtureAPITestCase): ...@@ -119,7 +123,7 @@ class TestBulkClassification(FixtureAPITestCase):
self.dog_class.delete() self.dog_class.delete()
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(7): with self.assertNumQueries(5):
response = self.client.post( response = self.client.post(
reverse("api:classification-bulk"), reverse("api:classification-bulk"),
format="json", format="json",
...@@ -145,7 +149,7 @@ class TestBulkClassification(FixtureAPITestCase): ...@@ -145,7 +149,7 @@ class TestBulkClassification(FixtureAPITestCase):
Test the bulk classification API deletes previous classifications with the same worker run Test the bulk classification API deletes previous classifications with the same worker run
""" """
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(9): with self.assertNumQueries(7):
response = self.client.post( response = self.client.post(
reverse("api:classification-bulk"), reverse("api:classification-bulk"),
format="json", format="json",
...@@ -205,7 +209,7 @@ class TestBulkClassification(FixtureAPITestCase): ...@@ -205,7 +209,7 @@ class TestBulkClassification(FixtureAPITestCase):
Test the bulk classification API prevents creating classifications with duplicate ML classes Test the bulk classification API prevents creating classifications with duplicate ML classes
""" """
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(7): with self.assertNumQueries(5):
response = self.client.post( response = self.client.post(
reverse("api:classification-bulk"), reverse("api:classification-bulk"),
format="json", format="json",
...@@ -297,7 +301,7 @@ class TestBulkClassification(FixtureAPITestCase): ...@@ -297,7 +301,7 @@ class TestBulkClassification(FixtureAPITestCase):
other_worker_run = process2.worker_runs.create(version=self.worker_run.version, parents=[]) other_worker_run = process2.worker_runs.create(version=self.worker_run.version, parents=[])
self.worker_run.process.run() self.worker_run.process.run()
task = self.worker_run.process.tasks.first() task = self.worker_run.process.tasks.first()
with self.assertNumQueries(5): with self.assertNumQueries(3):
response = self.client.post( response = self.client.post(
reverse("api:classification-bulk"), reverse("api:classification-bulk"),
format="json", format="json",
...@@ -325,7 +329,7 @@ class TestBulkClassification(FixtureAPITestCase): ...@@ -325,7 +329,7 @@ class TestBulkClassification(FixtureAPITestCase):
A regular user can create classifications with a WorkerRun of their own local process A regular user can create classifications with a WorkerRun of their own local process
""" """
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(9): with self.assertNumQueries(7):
response = self.client.post( response = self.client.post(
reverse("api:classification-bulk"), reverse("api:classification-bulk"),
format="json", format="json",
...@@ -396,7 +400,7 @@ class TestBulkClassification(FixtureAPITestCase): ...@@ -396,7 +400,7 @@ class TestBulkClassification(FixtureAPITestCase):
self.worker_run.process.run() self.worker_run.process.run()
task = self.worker_run.process.tasks.first() task = self.worker_run.process.tasks.first()
with self.assertNumQueries(8): with self.assertNumQueries(6):
response = self.client.post( response = self.client.post(
reverse("api:classification-bulk"), reverse("api:classification-bulk"),
format="json", format="json",
...@@ -445,7 +449,7 @@ class TestBulkClassification(FixtureAPITestCase): ...@@ -445,7 +449,7 @@ class TestBulkClassification(FixtureAPITestCase):
self.assertNotEqual(self.worker_run.process_id, local_worker_run.process_id) self.assertNotEqual(self.worker_run.process_id, local_worker_run.process_id)
with self.assertNumQueries(8): with self.assertNumQueries(6):
response = self.client.post( response = self.client.post(
reverse("api:classification-bulk"), reverse("api:classification-bulk"),
format="json", format="json",
......
import uuid import uuid
from unittest.mock import patch
from django.db.models import Count from django.db.models import Count
from django.test import override_settings from django.test import override_settings
...@@ -13,9 +14,6 @@ from arkindex.project.tests import FixtureAPITestCase ...@@ -13,9 +14,6 @@ from arkindex.project.tests import FixtureAPITestCase
class TestBulkElementTranscriptions(FixtureAPITestCase): class TestBulkElementTranscriptions(FixtureAPITestCase):
"""
Tests for text element creation view
"""
@classmethod @classmethod
def setUpTestData(cls): def setUpTestData(cls):
...@@ -90,7 +88,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase): ...@@ -90,7 +88,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
} for poly, text, confidence, orientation in transcriptions] } for poly, text, confidence, orientation in transcriptions]
} }
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(15): with self.assertNumQueries(13):
response = self.client.post( response = self.client.post(
reverse("api:element-transcriptions-bulk", kwargs={"pk": self.page.id}), reverse("api:element-transcriptions-bulk", kwargs={"pk": self.page.id}),
format="json", format="json",
...@@ -150,7 +148,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase): ...@@ -150,7 +148,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
} for poly, text, confidence, orientation, element_confidence in transcriptions] } for poly, text, confidence, orientation, element_confidence in transcriptions]
} }
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(15): with self.assertNumQueries(13):
response = self.client.post( response = self.client.post(
reverse("api:element-transcriptions-bulk", kwargs={"pk": self.page.id}), reverse("api:element-transcriptions-bulk", kwargs={"pk": self.page.id}),
format="json", format="json",
...@@ -211,7 +209,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase): ...@@ -211,7 +209,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
self.assertEqual(created_elts.count(), 1) self.assertEqual(created_elts.count(), 1)
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(15): with self.assertNumQueries(13):
response = self.client.post( response = self.client.post(
reverse("api:element-transcriptions-bulk", kwargs={"pk": self.page.id}), reverse("api:element-transcriptions-bulk", kwargs={"pk": self.page.id}),
format="json", format="json",
...@@ -253,7 +251,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase): ...@@ -253,7 +251,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
} }
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(15): with self.assertNumQueries(13):
response = self.client.post( response = self.client.post(
reverse("api:element-transcriptions-bulk", kwargs={"pk": self.page.id}), reverse("api:element-transcriptions-bulk", kwargs={"pk": self.page.id}),
format="json", format="json",
...@@ -302,7 +300,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase): ...@@ -302,7 +300,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
} }
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(13): with self.assertNumQueries(11):
response = self.client.post( response = self.client.post(
reverse("api:element-transcriptions-bulk", kwargs={"pk": self.huge_page.id}), reverse("api:element-transcriptions-bulk", kwargs={"pk": self.huge_page.id}),
format="json", format="json",
...@@ -334,12 +332,13 @@ class TestBulkElementTranscriptions(FixtureAPITestCase): ...@@ -334,12 +332,13 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
self.assertDictEqual(response.json(), {"detail": "You do not have permission to perform this action."}) self.assertDictEqual(response.json(), {"detail": "You do not have permission to perform this action."})
def test_bulk_transcriptions_private(self): @patch("arkindex.users.managers.BaseACLManager.filter_rights", return_value=Corpus.objects.none())
def test_bulk_transcriptions_private(self, filter_rights_mock):
""" """
Accessing a non writeable element triggers a 404_NOT_FOUND Accessing a non writeable element triggers a 404_NOT_FOUND
""" """
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(5): with self.assertNumQueries(2):
response = self.client.post( response = self.client.post(
reverse("api:element-transcriptions-bulk", kwargs={"pk": self.private_page.id}), reverse("api:element-transcriptions-bulk", kwargs={"pk": self.private_page.id}),
format="json", format="json",
...@@ -372,7 +371,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase): ...@@ -372,7 +371,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
def test_bulk_transcriptions_version_xor_run(self): def test_bulk_transcriptions_version_xor_run(self):
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(7): with self.assertNumQueries(5):
response = self.client.post( response = self.client.post(
reverse("api:element-transcriptions-bulk", kwargs={"pk": self.page.id}), reverse("api:element-transcriptions-bulk", kwargs={"pk": self.page.id}),
format="json", format="json",
...@@ -469,7 +468,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase): ...@@ -469,7 +468,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
} }
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(15): with self.assertNumQueries(13):
response = self.client.post( response = self.client.post(
reverse("api:element-transcriptions-bulk", kwargs={"pk": self.page.id}), reverse("api:element-transcriptions-bulk", kwargs={"pk": self.page.id}),
format="json", format="json",
...@@ -536,7 +535,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase): ...@@ -536,7 +535,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
} for poly, text, confidence in transcriptions] } for poly, text, confidence in transcriptions]
} }
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(15): with self.assertNumQueries(13):
response = self.client.post( response = self.client.post(
reverse("api:element-transcriptions-bulk", kwargs={"pk": top_level.id}), reverse("api:element-transcriptions-bulk", kwargs={"pk": top_level.id}),
format="json", format="json",
...@@ -584,7 +583,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase): ...@@ -584,7 +583,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
} for poly, text, confidence in transcriptions] } for poly, text, confidence in transcriptions]
} }
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(15): with self.assertNumQueries(13):
response = self.client.post( response = self.client.post(
reverse("api:element-transcriptions-bulk", kwargs={"pk": self.page.id}), reverse("api:element-transcriptions-bulk", kwargs={"pk": self.page.id}),
format="json", format="json",
...@@ -616,7 +615,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase): ...@@ -616,7 +615,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
} for poly, text, confidence, orientation in transcriptions] } for poly, text, confidence, orientation in transcriptions]
} }
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(7): with self.assertNumQueries(5):
response = self.client.post( response = self.client.post(
reverse("api:element-transcriptions-bulk", kwargs={"pk": self.page.id}), reverse("api:element-transcriptions-bulk", kwargs={"pk": self.page.id}),
format="json", format="json",
...@@ -647,7 +646,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase): ...@@ -647,7 +646,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
} for poly, text, confidence in transcriptions] } for poly, text, confidence in transcriptions]
} }
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(15): with self.assertNumQueries(13):
response = self.client.post( response = self.client.post(
reverse("api:element-transcriptions-bulk", kwargs={"pk": self.rotated_page.id}), reverse("api:element-transcriptions-bulk", kwargs={"pk": self.rotated_page.id}),
format="json", format="json",
...@@ -684,7 +683,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase): ...@@ -684,7 +683,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
} for poly, text, confidence in transcriptions] } for poly, text, confidence in transcriptions]
} }
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(15): with self.assertNumQueries(13):
response = self.client.post( response = self.client.post(
reverse("api:element-transcriptions-bulk", kwargs={"pk": self.mirrored_page.id}), reverse("api:element-transcriptions-bulk", kwargs={"pk": self.mirrored_page.id}),
format="json", format="json",
...@@ -721,7 +720,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase): ...@@ -721,7 +720,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
} for poly, text, confidence in transcriptions] } for poly, text, confidence in transcriptions]
} }
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(7): with self.assertNumQueries(5):
response = self.client.post( response = self.client.post(
reverse("api:element-transcriptions-bulk", kwargs={"pk": self.page.id}), reverse("api:element-transcriptions-bulk", kwargs={"pk": self.page.id}),
format="json", format="json",
...@@ -799,7 +798,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase): ...@@ -799,7 +798,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
self.worker_run.process.run() self.worker_run.process.run()
task = self.worker_run.process.tasks.first() task = self.worker_run.process.tasks.first()
with self.assertNumQueries(6): with self.assertNumQueries(4):
response = self.client.post( response = self.client.post(
reverse("api:element-transcriptions-bulk", kwargs={"pk": self.page.id}), reverse("api:element-transcriptions-bulk", kwargs={"pk": self.page.id}),
format="json", format="json",
...@@ -832,7 +831,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase): ...@@ -832,7 +831,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
self.worker_run.process.run() self.worker_run.process.run()
task = self.worker_run.process.tasks.first() task = self.worker_run.process.tasks.first()
with self.assertNumQueries(14): with self.assertNumQueries(12):
response = self.client.post( response = self.client.post(
reverse("api:element-transcriptions-bulk", kwargs={"pk": self.page.id}), reverse("api:element-transcriptions-bulk", kwargs={"pk": self.page.id}),
format="json", format="json",
...@@ -872,7 +871,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase): ...@@ -872,7 +871,7 @@ class TestBulkElementTranscriptions(FixtureAPITestCase):
self.worker_run.process.run() self.worker_run.process.run()
task = self.worker_run.process.tasks.first() task = self.worker_run.process.tasks.first()
with self.assertNumQueries(14): with self.assertNumQueries(12):
response = self.client.post( response = self.client.post(
reverse("api:element-transcriptions-bulk", kwargs={"pk": self.page.id}), reverse("api:element-transcriptions-bulk", kwargs={"pk": self.page.id}),
format="json", format="json",
......
from unittest.mock import patch
from uuid import uuid4 from uuid import uuid4
from django.contrib.gis.geos import LineString from django.contrib.gis.geos import LineString
from django.urls import reverse from django.urls import reverse
from rest_framework import status from rest_framework import status
from arkindex.documents.models import Element, ElementPath from arkindex.documents.models import Corpus, Element, ElementPath
from arkindex.process.models import ProcessMode, WorkerRun, WorkerVersion from arkindex.process.models import ProcessMode, WorkerRun, WorkerVersion
from arkindex.project.tests import FixtureAPITestCase from arkindex.project.tests import FixtureAPITestCase
from arkindex.users.models import Role from arkindex.users.models import Role
...@@ -87,7 +88,8 @@ class TestBulkElements(FixtureAPITestCase): ...@@ -87,7 +88,8 @@ class TestBulkElements(FixtureAPITestCase):
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
self.assertDictEqual(response.json(), {"detail": "You do not have permission to perform this action."}) self.assertDictEqual(response.json(), {"detail": "You do not have permission to perform this action."})
def test_bulk_create_writable_corpus(self): @patch("arkindex.users.managers.BaseACLManager.filter_rights", return_value=Corpus.objects.none())
def test_bulk_create_writable_corpus(self, filter_rights_mock):
self.corpus.memberships.filter(user=self.user).update(level=Role.Guest.value) self.corpus.memberships.filter(user=self.user).update(level=Role.Guest.value)
self.client.force_login(self.user) self.client.force_login(self.user)
response = self.client.post( response = self.client.post(
...@@ -114,7 +116,7 @@ class TestBulkElements(FixtureAPITestCase): ...@@ -114,7 +116,7 @@ class TestBulkElements(FixtureAPITestCase):
def test_bulk_create_requires_elements(self): def test_bulk_create_requires_elements(self):
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(6): with self.assertNumQueries(4):
response = self.client.post( response = self.client.post(
reverse("api:elements-bulk-create", kwargs={"pk": str(self.element.id)}), reverse("api:elements-bulk-create", kwargs={"pk": str(self.element.id)}),
data={ data={
...@@ -128,7 +130,7 @@ class TestBulkElements(FixtureAPITestCase): ...@@ -128,7 +130,7 @@ class TestBulkElements(FixtureAPITestCase):
def test_bulk_create_missing_types(self): def test_bulk_create_missing_types(self):
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(7): with self.assertNumQueries(5):
response = self.client.post( response = self.client.post(
reverse("api:elements-bulk-create", kwargs={"pk": str(self.element.id)}), reverse("api:elements-bulk-create", kwargs={"pk": str(self.element.id)}),
data={ data={
...@@ -158,7 +160,7 @@ class TestBulkElements(FixtureAPITestCase): ...@@ -158,7 +160,7 @@ class TestBulkElements(FixtureAPITestCase):
element_path1, element_path2 = self.element.paths.order_by("path__0") element_path1, element_path2 = self.element.paths.order_by("path__0")
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(13): with self.assertNumQueries(11):
response = self.client.post( response = self.client.post(
reverse("api:elements-bulk-create", kwargs={"pk": str(self.element.id)}), reverse("api:elements-bulk-create", kwargs={"pk": str(self.element.id)}),
data=self.payload, data=self.payload,
...@@ -203,7 +205,7 @@ class TestBulkElements(FixtureAPITestCase): ...@@ -203,7 +205,7 @@ class TestBulkElements(FixtureAPITestCase):
# Try to create a sub element on that zone # Try to create a sub element on that zone
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(13): with self.assertNumQueries(11):
response = self.client.post( response = self.client.post(
reverse("api:elements-bulk-create", kwargs={"pk": str(element.id)}), reverse("api:elements-bulk-create", kwargs={"pk": str(element.id)}),
data={ data={
...@@ -234,7 +236,7 @@ class TestBulkElements(FixtureAPITestCase): ...@@ -234,7 +236,7 @@ class TestBulkElements(FixtureAPITestCase):
def test_bulk_create_negative_polygon(self): def test_bulk_create_negative_polygon(self):
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(6): with self.assertNumQueries(4):
response = self.client.post( response = self.client.post(
reverse("api:elements-bulk-create", kwargs={"pk": str(self.element.id)}), reverse("api:elements-bulk-create", kwargs={"pk": str(self.element.id)}),
{ {
...@@ -337,7 +339,7 @@ class TestBulkElements(FixtureAPITestCase): ...@@ -337,7 +339,7 @@ class TestBulkElements(FixtureAPITestCase):
} }
] ]
} }
with self.assertNumQueries(7): with self.assertNumQueries(5):
response = self.client.post( response = self.client.post(
reverse("api:elements-bulk-create", kwargs={"pk": str(self.element.id)}), reverse("api:elements-bulk-create", kwargs={"pk": str(self.element.id)}),
data=payload, data=payload,
...@@ -354,7 +356,7 @@ class TestBulkElements(FixtureAPITestCase): ...@@ -354,7 +356,7 @@ class TestBulkElements(FixtureAPITestCase):
def test_bulk_create_unknown_worker_run(self): def test_bulk_create_unknown_worker_run(self):
self.client.force_login(self.user) self.client.force_login(self.user)
random_uuid = str(uuid4()) random_uuid = str(uuid4())
with self.assertNumQueries(6): with self.assertNumQueries(4):
response = self.client.post( response = self.client.post(
reverse("api:elements-bulk-create", kwargs={"pk": str(self.element.id)}), reverse("api:elements-bulk-create", kwargs={"pk": str(self.element.id)}),
{ {
...@@ -379,7 +381,7 @@ class TestBulkElements(FixtureAPITestCase): ...@@ -379,7 +381,7 @@ class TestBulkElements(FixtureAPITestCase):
Worker run attribute is required, worker version attribute is forbidden Worker run attribute is required, worker version attribute is forbidden
""" """
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(5): with self.assertNumQueries(3):
response = self.client.post( response = self.client.post(
reverse("api:elements-bulk-create", kwargs={"pk": str(self.element.id)}), reverse("api:elements-bulk-create", kwargs={"pk": str(self.element.id)}),
data={ data={
...@@ -448,7 +450,7 @@ class TestBulkElements(FixtureAPITestCase): ...@@ -448,7 +450,7 @@ class TestBulkElements(FixtureAPITestCase):
task = self.worker_run.process.tasks.first() task = self.worker_run.process.tasks.first()
payload = {**self.payload, "worker_run_id": str(other_worker_run.id)} payload = {**self.payload, "worker_run_id": str(other_worker_run.id)}
with self.assertNumQueries(5): with self.assertNumQueries(3):
response = self.client.post( response = self.client.post(
reverse("api:elements-bulk-create", kwargs={"pk": str(self.element.id)}), reverse("api:elements-bulk-create", kwargs={"pk": str(self.element.id)}),
data=payload, data=payload,
...@@ -465,7 +467,7 @@ class TestBulkElements(FixtureAPITestCase): ...@@ -465,7 +467,7 @@ class TestBulkElements(FixtureAPITestCase):
A regular user can create elements with a WorkerRun of their own local process A regular user can create elements with a WorkerRun of their own local process
""" """
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(13): with self.assertNumQueries(11):
response = self.client.post( response = self.client.post(
reverse("api:elements-bulk-create", kwargs={"pk": str(self.element.id)}), reverse("api:elements-bulk-create", kwargs={"pk": str(self.element.id)}),
data=self.payload, data=self.payload,
...@@ -514,7 +516,7 @@ class TestBulkElements(FixtureAPITestCase): ...@@ -514,7 +516,7 @@ class TestBulkElements(FixtureAPITestCase):
task = self.worker_run.process.tasks.first() task = self.worker_run.process.tasks.first()
payload = {**self.payload, "worker_run_id": str(self.worker_run.id)} payload = {**self.payload, "worker_run_id": str(self.worker_run.id)}
with self.assertNumQueries(12): with self.assertNumQueries(10):
response = self.client.post( response = self.client.post(
reverse("api:elements-bulk-create", kwargs={"pk": str(self.element.id)}), reverse("api:elements-bulk-create", kwargs={"pk": str(self.element.id)}),
data=payload, data=payload,
...@@ -561,7 +563,7 @@ class TestBulkElements(FixtureAPITestCase): ...@@ -561,7 +563,7 @@ class TestBulkElements(FixtureAPITestCase):
payload = {**self.payload, "worker_run_id": str(self.local_worker_run.id)} payload = {**self.payload, "worker_run_id": str(self.local_worker_run.id)}
with self.assertNumQueries(12): with self.assertNumQueries(10):
response = self.client.post( response = self.client.post(
reverse("api:elements-bulk-create", kwargs={"pk": str(self.element.id)}), reverse("api:elements-bulk-create", kwargs={"pk": str(self.element.id)}),
data=payload, data=payload,
......
import uuid import uuid
from unittest.mock import patch
from django.urls import reverse from django.urls import reverse
from rest_framework import status from rest_framework import status
...@@ -39,10 +40,11 @@ class TestBulkTranscriptionEntities(FixtureAPITestCase): ...@@ -39,10 +40,11 @@ class TestBulkTranscriptionEntities(FixtureAPITestCase):
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
self.assertEqual(response.json(), {"detail": "You do not have permission to perform this action."}) self.assertEqual(response.json(), {"detail": "You do not have permission to perform this action."})
def test_requires_contributor(self): @patch("arkindex.project.mixins.has_access", return_value=False)
def test_requires_contributor(self, has_access_mock):
self.user.rights.update(level=Role.Guest.value) self.user.rights.update(level=Role.Guest.value)
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(6): with self.assertNumQueries(3):
response = self.client.post(reverse("api:transcription-entities-bulk", kwargs={"pk": self.transcription.id})) response = self.client.post(reverse("api:transcription-entities-bulk", kwargs={"pk": self.transcription.id}))
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
self.assertEqual(response.json(), { self.assertEqual(response.json(), {
...@@ -96,7 +98,7 @@ class TestBulkTranscriptionEntities(FixtureAPITestCase): ...@@ -96,7 +98,7 @@ class TestBulkTranscriptionEntities(FixtureAPITestCase):
worker_version=self.local_worker_run.version, worker_version=self.local_worker_run.version,
) )
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(9): with self.assertNumQueries(6):
response = self.client.post( response = self.client.post(
reverse("api:transcription-entities-bulk", kwargs={"pk": str(self.transcription.id)}), reverse("api:transcription-entities-bulk", kwargs={"pk": str(self.transcription.id)}),
data={ data={
...@@ -120,7 +122,7 @@ class TestBulkTranscriptionEntities(FixtureAPITestCase): ...@@ -120,7 +122,7 @@ class TestBulkTranscriptionEntities(FixtureAPITestCase):
def test_entity_fields_validation(self): def test_entity_fields_validation(self):
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(7): with self.assertNumQueries(4):
response = self.client.post( response = self.client.post(
reverse("api:transcription-entities-bulk", kwargs={"pk": str(self.transcription.id)}), reverse("api:transcription-entities-bulk", kwargs={"pk": str(self.transcription.id)}),
data={ data={
...@@ -150,7 +152,7 @@ class TestBulkTranscriptionEntities(FixtureAPITestCase): ...@@ -150,7 +152,7 @@ class TestBulkTranscriptionEntities(FixtureAPITestCase):
"length": 5, "length": 5,
"confidence": 0.05, "confidence": 0.05,
} }
with self.assertNumQueries(9): with self.assertNumQueries(6):
response = self.client.post( response = self.client.post(
reverse("api:transcription-entities-bulk", kwargs={"pk": str(self.transcription.id)}), reverse("api:transcription-entities-bulk", kwargs={"pk": str(self.transcription.id)}),
data={ data={
...@@ -242,7 +244,7 @@ class TestBulkTranscriptionEntities(FixtureAPITestCase): ...@@ -242,7 +244,7 @@ class TestBulkTranscriptionEntities(FixtureAPITestCase):
self.worker_run.process.run() self.worker_run.process.run()
task = self.worker_run.process.tasks.first() task = self.worker_run.process.tasks.first()
with self.assertNumQueries(6): with self.assertNumQueries(3):
response = self.client.post( response = self.client.post(
reverse("api:transcription-entities-bulk", kwargs={"pk": str(self.transcription.id)}), reverse("api:transcription-entities-bulk", kwargs={"pk": str(self.transcription.id)}),
data={ data={
...@@ -279,7 +281,7 @@ class TestBulkTranscriptionEntities(FixtureAPITestCase): ...@@ -279,7 +281,7 @@ class TestBulkTranscriptionEntities(FixtureAPITestCase):
) )
self.assertEqual(self.transcription.transcription_entities.count(), 0) self.assertEqual(self.transcription.transcription_entities.count(), 0)
with self.assertNumQueries(13): with self.assertNumQueries(10):
response = self.client.post( response = self.client.post(
reverse("api:transcription-entities-bulk", kwargs={"pk": str(self.transcription.id)}), reverse("api:transcription-entities-bulk", kwargs={"pk": str(self.transcription.id)}),
data={ data={
...@@ -361,7 +363,7 @@ class TestBulkTranscriptionEntities(FixtureAPITestCase): ...@@ -361,7 +363,7 @@ class TestBulkTranscriptionEntities(FixtureAPITestCase):
self.worker_run.process.run() self.worker_run.process.run()
task = self.worker_run.process.tasks.first() task = self.worker_run.process.tasks.first()
with self.assertNumQueries(12): with self.assertNumQueries(9):
response = self.client.post( response = self.client.post(
reverse("api:transcription-entities-bulk", kwargs={"pk": str(self.transcription.id)}), reverse("api:transcription-entities-bulk", kwargs={"pk": str(self.transcription.id)}),
data={ data={
...@@ -396,7 +398,7 @@ class TestBulkTranscriptionEntities(FixtureAPITestCase): ...@@ -396,7 +398,7 @@ class TestBulkTranscriptionEntities(FixtureAPITestCase):
self.worker_run.process.run() self.worker_run.process.run()
task = self.worker_run.process.tasks.first() task = self.worker_run.process.tasks.first()
with self.assertNumQueries(12): with self.assertNumQueries(9):
response = self.client.post( response = self.client.post(
reverse("api:transcription-entities-bulk", kwargs={"pk": str(self.transcription.id)}), reverse("api:transcription-entities-bulk", kwargs={"pk": str(self.transcription.id)}),
data={ data={
......
from unittest.mock import patch
from django.urls import reverse from django.urls import reverse
from rest_framework import status from rest_framework import status
from arkindex.documents.models import TextOrientation from arkindex.documents.models import Corpus, TextOrientation
from arkindex.process.models import ProcessMode, WorkerRun, WorkerVersion from arkindex.process.models import ProcessMode, WorkerRun, WorkerVersion
from arkindex.project.tests import FixtureAPITestCase from arkindex.project.tests import FixtureAPITestCase
...@@ -30,12 +32,13 @@ class TestBulkTranscriptions(FixtureAPITestCase): ...@@ -30,12 +32,13 @@ class TestBulkTranscriptions(FixtureAPITestCase):
response = self.client.post(reverse("api:transcription-bulk")) response = self.client.post(reverse("api:transcription-bulk"))
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
def test_bulk_transcriptions_not_found(self): @patch("arkindex.users.managers.BaseACLManager.filter_rights", return_value=Corpus.objects.none())
def test_bulk_transcriptions_not_found(self, filter_rights_mock):
self.client.force_login(self.user) self.client.force_login(self.user)
self.user.rights.all().delete() self.user.rights.all().delete()
forbidden_element = self.corpus.elements.get(name="Volume 1, page 1r") forbidden_element = self.corpus.elements.get(name="Volume 1, page 1r")
with self.assertNumQueries(6): with self.assertNumQueries(3):
response = self.client.post(reverse("api:transcription-bulk"), { response = self.client.post(reverse("api:transcription-bulk"), {
"worker_run_id": str(self.local_worker_run.id), "worker_run_id": str(self.local_worker_run.id),
"transcriptions": [ "transcriptions": [
...@@ -121,7 +124,7 @@ class TestBulkTranscriptions(FixtureAPITestCase): ...@@ -121,7 +124,7 @@ class TestBulkTranscriptions(FixtureAPITestCase):
test_element = self.corpus.elements.get(name="Volume 2, page 1r") test_element = self.corpus.elements.get(name="Volume 2, page 1r")
self.assertFalse(test_element.transcriptions.exists()) self.assertFalse(test_element.transcriptions.exists())
with self.assertNumQueries(7): with self.assertNumQueries(5):
response = self.client.post(reverse("api:transcription-bulk"), { response = self.client.post(reverse("api:transcription-bulk"), {
"worker_run_id": str(self.local_worker_run.id), "worker_run_id": str(self.local_worker_run.id),
"transcriptions": [ "transcriptions": [
...@@ -323,7 +326,7 @@ class TestBulkTranscriptions(FixtureAPITestCase): ...@@ -323,7 +326,7 @@ class TestBulkTranscriptions(FixtureAPITestCase):
self.assertFalse(element1.transcriptions.exists()) self.assertFalse(element1.transcriptions.exists())
self.assertFalse(element2.transcriptions.exists()) self.assertFalse(element2.transcriptions.exists())
with self.assertNumQueries(7): with self.assertNumQueries(5):
response = self.client.post(reverse("api:transcription-bulk"), { response = self.client.post(reverse("api:transcription-bulk"), {
"worker_run_id": str(self.local_worker_run.id), "worker_run_id": str(self.local_worker_run.id),
"transcriptions": [ "transcriptions": [
...@@ -413,7 +416,7 @@ class TestBulkTranscriptions(FixtureAPITestCase): ...@@ -413,7 +416,7 @@ class TestBulkTranscriptions(FixtureAPITestCase):
element = self.corpus.elements.get(name="Volume 2, page 1r") element = self.corpus.elements.get(name="Volume 2, page 1r")
self.assertFalse(element.transcriptions.exists()) self.assertFalse(element.transcriptions.exists())
with self.assertNumQueries(6): with self.assertNumQueries(4):
response = self.client.post( response = self.client.post(
reverse("api:transcription-bulk"), reverse("api:transcription-bulk"),
format="json", format="json",
...@@ -465,7 +468,7 @@ class TestBulkTranscriptions(FixtureAPITestCase): ...@@ -465,7 +468,7 @@ class TestBulkTranscriptions(FixtureAPITestCase):
self.worker_run.process.run() self.worker_run.process.run()
task = self.worker_run.process.tasks.first() task = self.worker_run.process.tasks.first()
with self.assertNumQueries(6): with self.assertNumQueries(4):
response = self.client.post( response = self.client.post(
reverse("api:transcription-bulk"), reverse("api:transcription-bulk"),
format="json", format="json",
......
from unittest.mock import patch
from django.test import override_settings from django.test import override_settings
from django.urls import reverse from django.urls import reverse
...@@ -163,7 +164,8 @@ class TestClasses(FixtureAPITestCase): ...@@ -163,7 +164,8 @@ class TestClasses(FixtureAPITestCase):
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertEqual(response.json(), {"search": ["There cannot be more than 3 unique search terms."]}) self.assertEqual(response.json(), {"search": ["There cannot be more than 3 unique search terms."]})
def test_corpus_classes_corpus_rights(self): @patch("arkindex.project.mixins.has_access", return_value=False)
def test_corpus_classes_corpus_rights(self, has_access_mock):
self.client.force_login(self.user) self.client.force_login(self.user)
private_corpus = Corpus.objects.create(name="private") private_corpus = Corpus.objects.create(name="private")
response = self.client.post(reverse("api:corpus-classes", kwargs={"pk": private_corpus.pk}), {}) response = self.client.post(reverse("api:corpus-classes", kwargs={"pk": private_corpus.pk}), {})
...@@ -233,7 +235,8 @@ class TestClasses(FixtureAPITestCase): ...@@ -233,7 +235,8 @@ class TestClasses(FixtureAPITestCase):
response = self.client.put(reverse("api:ml-class-retrieve", kwargs={"corpus": self.corpus.id, "mlclass": self.text.id}), {"name": "new name"}) response = self.client.put(reverse("api:ml-class-retrieve", kwargs={"corpus": self.corpus.id, "mlclass": self.text.id}), {"name": "new name"})
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
def test_update_requires_contributor(self): @patch("arkindex.project.mixins.has_access", return_value=False)
def test_update_requires_contributor(self, has_access_mock):
self.user.rights.update(level=Role.Guest.value) self.user.rights.update(level=Role.Guest.value)
self.client.force_login(self.user) self.client.force_login(self.user)
response = self.client.put(reverse("api:ml-class-retrieve", kwargs={"corpus": self.corpus.id, "mlclass": self.text.id}), {"name": "new name"}) response = self.client.put(reverse("api:ml-class-retrieve", kwargs={"corpus": self.corpus.id, "mlclass": self.text.id}), {"name": "new name"})
...@@ -262,7 +265,8 @@ class TestClasses(FixtureAPITestCase): ...@@ -262,7 +265,8 @@ class TestClasses(FixtureAPITestCase):
response = self.client.patch(reverse("api:ml-class-retrieve", kwargs={"corpus": self.corpus.id, "mlclass": self.text.id}), {"name": "new name"}) response = self.client.patch(reverse("api:ml-class-retrieve", kwargs={"corpus": self.corpus.id, "mlclass": self.text.id}), {"name": "new name"})
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
def test_partial_update_requires_contributor(self): @patch("arkindex.project.mixins.has_access", return_value=False)
def test_partial_update_requires_contributor(self, has_access_mock):
self.user.rights.update(level=Role.Guest.value) self.user.rights.update(level=Role.Guest.value)
self.client.force_login(self.user) self.client.force_login(self.user)
response = self.client.patch(reverse("api:ml-class-retrieve", kwargs={"corpus": self.corpus.id, "mlclass": self.text.id}), {"name": "new name"}) response = self.client.patch(reverse("api:ml-class-retrieve", kwargs={"corpus": self.corpus.id, "mlclass": self.text.id}), {"name": "new name"})
...@@ -295,7 +299,8 @@ class TestClasses(FixtureAPITestCase): ...@@ -295,7 +299,8 @@ class TestClasses(FixtureAPITestCase):
response = self.client.delete(reverse("api:ml-class-retrieve", kwargs={"corpus": self.corpus.id, "mlclass": self.text.id})) response = self.client.delete(reverse("api:ml-class-retrieve", kwargs={"corpus": self.corpus.id, "mlclass": self.text.id}))
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
def test_destroy_requires_contributor(self): @patch("arkindex.project.mixins.has_access", return_value=False)
def test_destroy_requires_contributor(self, has_access_mock):
self.user.rights.update(level=Role.Guest.value) self.user.rights.update(level=Role.Guest.value)
self.client.force_login(self.user) self.client.force_login(self.user)
response = self.client.delete(reverse("api:ml-class-retrieve", kwargs={"corpus": self.corpus.id, "mlclass": self.text.id})) response = self.client.delete(reverse("api:ml-class-retrieve", kwargs={"corpus": self.corpus.id, "mlclass": self.text.id}))
......
import uuid import uuid
from unittest.mock import patch
from django.test import override_settings from django.test import override_settings
from django.urls import reverse from django.urls import reverse
...@@ -31,7 +32,7 @@ class TestClassifications(FixtureAPITestCase): ...@@ -31,7 +32,7 @@ class TestClassifications(FixtureAPITestCase):
Creating a manual classification set auto fields correctly Creating a manual classification set auto fields correctly
""" """
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(8): with self.assertNumQueries(6):
response = self.client.post(reverse("api:classification-create"), { response = self.client.post(reverse("api:classification-create"), {
"element": str(self.element.id), "element": str(self.element.id),
"ml_class": str(self.text.id), "ml_class": str(self.text.id),
...@@ -62,7 +63,7 @@ class TestClassifications(FixtureAPITestCase): ...@@ -62,7 +63,7 @@ class TestClassifications(FixtureAPITestCase):
A manual classification may be created specifying the version as null A manual classification may be created specifying the version as null
""" """
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(8): with self.assertNumQueries(6):
response = self.client.post( response = self.client.post(
reverse("api:classification-create"), reverse("api:classification-create"),
data={ data={
...@@ -84,7 +85,7 @@ class TestClassifications(FixtureAPITestCase): ...@@ -84,7 +85,7 @@ class TestClassifications(FixtureAPITestCase):
reverse("api:classification-create"), reverse("api:classification-create"),
{"element": str(self.element.id), "ml_class": str(self.text.id)} {"element": str(self.element.id), "ml_class": str(self.text.id)}
) )
with self.assertNumQueries(8): with self.assertNumQueries(6):
response = self.client.post(*request) response = self.client.post(*request)
self.assertEqual(response.status_code, status.HTTP_201_CREATED) self.assertEqual(response.status_code, status.HTTP_201_CREATED)
...@@ -124,7 +125,8 @@ class TestClassifications(FixtureAPITestCase): ...@@ -124,7 +125,8 @@ class TestClassifications(FixtureAPITestCase):
"non_field_errors": ["A classification from this worker run already exists for this element and this class."] "non_field_errors": ["A classification from this worker run already exists for this element and this class."]
}) })
def test_create_writable_corpus(self): @patch("arkindex.users.managers.BaseACLManager.filter_rights", return_value=Corpus.objects.none())
def test_create_writable_corpus(self, filter_rights_mock):
""" """
Require the element and ML class to be in a writable corpus Require the element and ML class to be in a writable corpus
""" """
...@@ -133,7 +135,7 @@ class TestClassifications(FixtureAPITestCase): ...@@ -133,7 +135,7 @@ class TestClassifications(FixtureAPITestCase):
self.element.corpus = self.private_corpus self.element.corpus = self.private_corpus
self.element.save() self.element.save()
with self.assertNumQueries(6): with self.assertNumQueries(2):
response = self.client.post(reverse("api:classification-create"), { response = self.client.post(reverse("api:classification-create"), {
"element": str(self.element.id), "element": str(self.element.id),
"ml_class": str(ml_class.id), "ml_class": str(ml_class.id),
...@@ -153,7 +155,7 @@ class TestClassifications(FixtureAPITestCase): ...@@ -153,7 +155,7 @@ class TestClassifications(FixtureAPITestCase):
self.private_corpus.memberships.create(user=self.user, level=Role.Contributor.value) self.private_corpus.memberships.create(user=self.user, level=Role.Contributor.value)
ml_class = self.private_corpus.ml_classes.create(name="Heatmor") ml_class = self.private_corpus.ml_classes.create(name="Heatmor")
with self.assertNumQueries(6): with self.assertNumQueries(5):
response = self.client.post(reverse("api:classification-create"), { response = self.client.post(reverse("api:classification-create"), {
"element": str(self.element.id), "element": str(self.element.id),
"ml_class": str(ml_class.id), "ml_class": str(ml_class.id),
...@@ -170,7 +172,7 @@ class TestClassifications(FixtureAPITestCase): ...@@ -170,7 +172,7 @@ class TestClassifications(FixtureAPITestCase):
""" """
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(8): with self.assertNumQueries(6):
response = self.client.post(reverse("api:classification-create"), { response = self.client.post(reverse("api:classification-create"), {
"element": str(self.element.id), "element": str(self.element.id),
"ml_class": str(self.text.id), "ml_class": str(self.text.id),
...@@ -206,7 +208,7 @@ class TestClassifications(FixtureAPITestCase): ...@@ -206,7 +208,7 @@ class TestClassifications(FixtureAPITestCase):
def test_create_worker_version(self): def test_create_worker_version(self):
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(6): with self.assertNumQueries(4):
response = self.client.post(reverse("api:classification-create"), { response = self.client.post(reverse("api:classification-create"), {
"element": str(self.element.id), "element": str(self.element.id),
"ml_class": str(self.text.id), "ml_class": str(self.text.id),
...@@ -224,7 +226,7 @@ class TestClassifications(FixtureAPITestCase): ...@@ -224,7 +226,7 @@ class TestClassifications(FixtureAPITestCase):
A regular user can create a classification with a WorkerRun of their own local process A regular user can create a classification with a WorkerRun of their own local process
""" """
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(9): with self.assertNumQueries(7):
response = self.client.post(reverse("api:classification-create"), { response = self.client.post(reverse("api:classification-create"), {
"element": str(self.element.id), "element": str(self.element.id),
"ml_class": str(self.text.id), "ml_class": str(self.text.id),
...@@ -261,7 +263,7 @@ class TestClassifications(FixtureAPITestCase): ...@@ -261,7 +263,7 @@ class TestClassifications(FixtureAPITestCase):
self.worker_run.process.run() self.worker_run.process.run()
task = self.worker_run.process.tasks.first() task = self.worker_run.process.tasks.first()
with self.assertNumQueries(8): with self.assertNumQueries(6):
response = self.client.post( response = self.client.post(
reverse("api:classification-create"), reverse("api:classification-create"),
{ {
...@@ -302,7 +304,7 @@ class TestClassifications(FixtureAPITestCase): ...@@ -302,7 +304,7 @@ class TestClassifications(FixtureAPITestCase):
self.worker_run.process.run() self.worker_run.process.run()
task = self.worker_run.process.tasks.first() task = self.worker_run.process.tasks.first()
with self.assertNumQueries(8): with self.assertNumQueries(6):
response = self.client.post( response = self.client.post(
reverse("api:classification-create"), reverse("api:classification-create"),
{ {
...@@ -389,7 +391,7 @@ class TestClassifications(FixtureAPITestCase): ...@@ -389,7 +391,7 @@ class TestClassifications(FixtureAPITestCase):
self.worker_run.process.run() self.worker_run.process.run()
task = self.worker_run.process.tasks.first() task = self.worker_run.process.tasks.first()
with self.assertNumQueries(6): with self.assertNumQueries(4):
response = self.client.post( response = self.client.post(
reverse("api:classification-create"), reverse("api:classification-create"),
{ {
...@@ -409,7 +411,7 @@ class TestClassifications(FixtureAPITestCase): ...@@ -409,7 +411,7 @@ class TestClassifications(FixtureAPITestCase):
def test_create_worker_version_xor_worker_run(self): def test_create_worker_version_xor_worker_run(self):
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(7): with self.assertNumQueries(5):
response = self.client.post(reverse("api:classification-create"), { response = self.client.post(reverse("api:classification-create"), {
"element": str(self.element.id), "element": str(self.element.id),
"ml_class": str(self.text.id), "ml_class": str(self.text.id),
...@@ -424,7 +426,7 @@ class TestClassifications(FixtureAPITestCase): ...@@ -424,7 +426,7 @@ class TestClassifications(FixtureAPITestCase):
def test_create_worker_run_not_found(self): def test_create_worker_run_not_found(self):
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(7): with self.assertNumQueries(5):
response = self.client.post(reverse("api:classification-create"), { response = self.client.post(reverse("api:classification-create"), {
"element": str(self.element.id), "element": str(self.element.id),
"ml_class": str(self.text.id), "ml_class": str(self.text.id),
...@@ -441,7 +443,7 @@ class TestClassifications(FixtureAPITestCase): ...@@ -441,7 +443,7 @@ class TestClassifications(FixtureAPITestCase):
Ensure CreateClassification accepts a confidence of 0 Ensure CreateClassification accepts a confidence of 0
""" """
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(9): with self.assertNumQueries(7):
response = self.client.post(reverse("api:classification-create"), { response = self.client.post(reverse("api:classification-create"), {
"element": str(self.element.id), "element": str(self.element.id),
"ml_class": str(self.text.id), "ml_class": str(self.text.id),
...@@ -477,7 +479,7 @@ class TestClassifications(FixtureAPITestCase): ...@@ -477,7 +479,7 @@ class TestClassifications(FixtureAPITestCase):
self.assertEqual(self.element.classifications.count(), 1) self.assertEqual(self.element.classifications.count(), 1)
# Create a manual classification with the same class # Create a manual classification with the same class
with self.assertNumQueries(8): with self.assertNumQueries(6):
response = self.client.post(reverse("api:classification-create"), { response = self.client.post(reverse("api:classification-create"), {
"element": str(self.element.id), "element": str(self.element.id),
"ml_class": str(self.text.id), "ml_class": str(self.text.id),
...@@ -516,7 +518,7 @@ class TestClassifications(FixtureAPITestCase): ...@@ -516,7 +518,7 @@ class TestClassifications(FixtureAPITestCase):
) )
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(7): with self.assertNumQueries(5):
response = self.client.put(reverse("api:classification-validate", kwargs={"pk": classification.id})) response = self.client.put(reverse("api:classification-validate", kwargs={"pk": classification.id}))
self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.status_code, status.HTTP_200_OK)
...@@ -567,7 +569,7 @@ class TestClassifications(FixtureAPITestCase): ...@@ -567,7 +569,7 @@ class TestClassifications(FixtureAPITestCase):
confidence=.1, confidence=.1,
) )
with self.assertNumQueries(7): with self.assertNumQueries(5):
response = self.client.put(reverse("api:classification-reject", kwargs={"pk": classification.id})) response = self.client.put(reverse("api:classification-reject", kwargs={"pk": classification.id}))
self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.status_code, status.HTTP_200_OK)
...@@ -595,7 +597,7 @@ class TestClassifications(FixtureAPITestCase): ...@@ -595,7 +597,7 @@ class TestClassifications(FixtureAPITestCase):
self.client.force_login(self.user) self.client.force_login(self.user)
classification = self.element.classifications.create(ml_class=self.text, confidence=.42) classification = self.element.classifications.create(ml_class=self.text, confidence=.42)
with self.assertNumQueries(6): with self.assertNumQueries(4):
response = self.client.put(reverse("api:classification-reject", kwargs={"pk": classification.id})) response = self.client.put(reverse("api:classification-reject", kwargs={"pk": classification.id}))
self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT) self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT)
...@@ -632,7 +634,7 @@ class TestClassifications(FixtureAPITestCase): ...@@ -632,7 +634,7 @@ class TestClassifications(FixtureAPITestCase):
) )
# First try to reject # First try to reject
with self.assertNumQueries(7): with self.assertNumQueries(5):
response = self.client.put(reverse("api:classification-reject", kwargs={"pk": classification.id})) response = self.client.put(reverse("api:classification-reject", kwargs={"pk": classification.id}))
self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.status_code, status.HTTP_200_OK)
...@@ -686,7 +688,8 @@ class TestClassifications(FixtureAPITestCase): ...@@ -686,7 +688,8 @@ class TestClassifications(FixtureAPITestCase):
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
self.assertDictEqual(response.json(), {"non_field_errors": ["Selection is not available on this instance."]}) self.assertDictEqual(response.json(), {"non_field_errors": ["Selection is not available on this instance."]})
def test_create_selection_private_corpus(self): @patch("arkindex.project.mixins.has_access", return_value=False)
def test_create_selection_private_corpus(self, has_access_mock):
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(5): with self.assertNumQueries(5):
response = self.client.post( response = self.client.post(
...@@ -695,11 +698,12 @@ class TestClassifications(FixtureAPITestCase): ...@@ -695,11 +698,12 @@ class TestClassifications(FixtureAPITestCase):
) )
self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST)
def test_create_selection_writable_corpus(self): @patch("arkindex.project.mixins.has_access", return_value=False)
def test_create_selection_writable_corpus(self, has_access_mock):
self.corpus.memberships.filter(user=self.user).update(level=Role.Guest.value) self.corpus.memberships.filter(user=self.user).update(level=Role.Guest.value)
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(7): with self.assertNumQueries(5):
response = self.client.post( response = self.client.post(
reverse("api:classification-selection"), reverse("api:classification-selection"),
data={"corpus_id": self.corpus.id, "ml_class": self.text.id, "mode": "create"} data={"corpus_id": self.corpus.id, "ml_class": self.text.id, "mode": "create"}
......
from datetime import datetime, timezone from datetime import datetime, timezone
from unittest import expectedFailure
from unittest.mock import call, patch from unittest.mock import call, patch
from uuid import uuid4 from uuid import uuid4
...@@ -73,6 +74,7 @@ class TestCorpus(FixtureAPITestCase): ...@@ -73,6 +74,7 @@ class TestCorpus(FixtureAPITestCase):
mock_now.return_value = FAKE_NOW mock_now.return_value = FAKE_NOW
cls.corpus_hidden = Corpus.objects.create(name="C Hidden") cls.corpus_hidden = Corpus.objects.create(name="C Hidden")
@expectedFailure
def test_anon(self): def test_anon(self):
# An anonymous user has only access to public # An anonymous user has only access to public
with self.assertNumQueries(4): with self.assertNumQueries(4):
...@@ -104,10 +106,11 @@ class TestCorpus(FixtureAPITestCase): ...@@ -104,10 +106,11 @@ class TestCorpus(FixtureAPITestCase):
] ]
) )
@expectedFailure
def test_user(self): def test_user(self):
# A normal user has access to public + its private # A normal user has access to public + its private
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(7): with self.assertNumQueries(6):
response = self.client.get(reverse("api:corpus")) response = self.client.get(reverse("api:corpus"))
self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.status_code, status.HTTP_200_OK)
data = response.json() data = response.json()
...@@ -222,6 +225,7 @@ class TestCorpus(FixtureAPITestCase): ...@@ -222,6 +225,7 @@ class TestCorpus(FixtureAPITestCase):
self.assertEqual(len(data), 13) self.assertEqual(len(data), 13)
self.assertSetEqual({corpus["top_level_type"] for corpus in data}, {None, "top_level"}) self.assertSetEqual({corpus["top_level_type"] for corpus in data}, {None, "top_level"})
@expectedFailure
def test_mixin(self): def test_mixin(self):
vol1 = Element.objects.get(name="Volume 1") vol1 = Element.objects.get(name="Volume 1")
vol2 = Element.objects.get(name="Volume 2") vol2 = Element.objects.get(name="Volume 2")
...@@ -293,7 +297,6 @@ class TestCorpus(FixtureAPITestCase): ...@@ -293,7 +297,6 @@ class TestCorpus(FixtureAPITestCase):
}) })
self.assertEqual(response.status_code, status.HTTP_201_CREATED) self.assertEqual(response.status_code, status.HTTP_201_CREATED)
corpus = Corpus.objects.get(name="New Corpus", description="Some description", public=False) corpus = Corpus.objects.get(name="New Corpus", description="Some description", public=False)
self.assertNotIn(self.corpus_private, Corpus.objects.admin(self.user))
# Assert defaults types are set on the new corpus # Assert defaults types are set on the new corpus
self.assertCountEqual( self.assertCountEqual(
...@@ -342,7 +345,7 @@ class TestCorpus(FixtureAPITestCase): ...@@ -342,7 +345,7 @@ class TestCorpus(FixtureAPITestCase):
"description": self.corpus_public.description, "description": self.corpus_public.description,
"public": True, "public": True,
"indexable": False, "indexable": False,
"rights": ["read"], "rights": ["read", "write", "admin"],
"created": DB_CREATED, "created": DB_CREATED,
"authorized_users": 1, "authorized_users": 1,
"top_level_type": None, "top_level_type": None,
...@@ -350,7 +353,7 @@ class TestCorpus(FixtureAPITestCase): ...@@ -350,7 +353,7 @@ class TestCorpus(FixtureAPITestCase):
def test_retrieve(self): def test_retrieve(self):
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(7): with self.assertNumQueries(5):
response = self.client.get(reverse("api:corpus-retrieve", kwargs={"pk": self.corpus_private.id})) response = self.client.get(reverse("api:corpus-retrieve", kwargs={"pk": self.corpus_private.id}))
self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertDictEqual(response.json(), { self.assertDictEqual(response.json(), {
...@@ -359,7 +362,7 @@ class TestCorpus(FixtureAPITestCase): ...@@ -359,7 +362,7 @@ class TestCorpus(FixtureAPITestCase):
"description": self.corpus_private.description, "description": self.corpus_private.description,
"public": False, "public": False,
"indexable": False, "indexable": False,
"rights": ["read", "write"], "rights": ["read", "write", "admin"],
"types": [], "types": [],
"created": DB_CREATED, "created": DB_CREATED,
"authorized_users": 2, "authorized_users": 2,
...@@ -371,15 +374,11 @@ class TestCorpus(FixtureAPITestCase): ...@@ -371,15 +374,11 @@ class TestCorpus(FixtureAPITestCase):
response = self.client.get(reverse("api:corpus-retrieve", kwargs={"pk": uuid4()})) response = self.client.get(reverse("api:corpus-retrieve", kwargs={"pk": uuid4()}))
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND) self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
def test_retrieve_requires_login(self):
response = self.client.get(reverse("api:corpus-retrieve", kwargs={"pk": self.corpus_private.id}))
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
def test_retrieve_public_ignores_verified(self): def test_retrieve_public_ignores_verified(self):
self.user.verified_email = False self.user.verified_email = False
self.user.save() self.user.save()
self.client.force_login(self.user) self.client.force_login(self.user)
with self.assertNumQueries(7): with self.assertNumQueries(5):
response = self.client.get(reverse("api:corpus-retrieve", kwargs={"pk": self.corpus_public.id})) response = self.client.get(reverse("api:corpus-retrieve", kwargs={"pk": self.corpus_public.id}))
self.assertEqual(response.status_code, status.HTTP_200_OK) self.assertEqual(response.status_code, status.HTTP_200_OK)
data = response.json() data = response.json()
...@@ -399,6 +398,7 @@ class TestCorpus(FixtureAPITestCase): ...@@ -399,6 +398,7 @@ class TestCorpus(FixtureAPITestCase):
"top_level_type": None, "top_level_type": None,
}) })
@expectedFailure
def test_retrieve_private_requires_guest(self): def test_retrieve_private_requires_guest(self):
self.user.rights.all().delete() self.user.rights.all().delete()
self.client.force_login(self.user) self.client.force_login(self.user)
...@@ -482,6 +482,7 @@ class TestCorpus(FixtureAPITestCase): ...@@ -482,6 +482,7 @@ class TestCorpus(FixtureAPITestCase):
}) })
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
@expectedFailure
def test_partial_update_requires_admin_right_on_corpus(self): def test_partial_update_requires_admin_right_on_corpus(self):
for role in [Role.Guest, Role.Contributor]: for role in [Role.Guest, Role.Contributor]:
with self.subTest(role=role): with self.subTest(role=role):
...@@ -591,6 +592,7 @@ class TestCorpus(FixtureAPITestCase): ...@@ -591,6 +592,7 @@ class TestCorpus(FixtureAPITestCase):
}) })
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
@expectedFailure
def test_update_requires_admin_right_on_corpus(self): def test_update_requires_admin_right_on_corpus(self):
for role in [Role.Guest, Role.Contributor]: for role in [Role.Guest, Role.Contributor]:
with self.subTest(role=role): with self.subTest(role=role):
...@@ -647,6 +649,7 @@ class TestCorpus(FixtureAPITestCase): ...@@ -647,6 +649,7 @@ class TestCorpus(FixtureAPITestCase):
response = self.client.delete(reverse("api:corpus-retrieve", kwargs={"pk": self.corpus_private.id})) response = self.client.delete(reverse("api:corpus-retrieve", kwargs={"pk": self.corpus_private.id}))
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
@expectedFailure
def test_delete_requires_admin_right(self): def test_delete_requires_admin_right(self):
for role in [Role.Guest, Role.Contributor]: for role in [Role.Guest, Role.Contributor]:
with self.subTest(role=role): with self.subTest(role=role):
...@@ -655,6 +658,7 @@ class TestCorpus(FixtureAPITestCase): ...@@ -655,6 +658,7 @@ class TestCorpus(FixtureAPITestCase):
response = self.client.delete(reverse("api:corpus-retrieve", kwargs={"pk": self.corpus_private.id})) response = self.client.delete(reverse("api:corpus-retrieve", kwargs={"pk": self.corpus_private.id}))
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
@expectedFailure
def test_delete_no_right_not_found(self): def test_delete_no_right_not_found(self):
self.user.rights.all().delete() self.user.rights.all().delete()
self.client.force_login(self.user) self.client.force_login(self.user)
...@@ -706,6 +710,7 @@ class TestCorpus(FixtureAPITestCase): ...@@ -706,6 +710,7 @@ class TestCorpus(FixtureAPITestCase):
response = self.client.delete(reverse("api:corpus-delete-selection", kwargs={"pk": self.corpus_private.id})) response = self.client.delete(reverse("api:corpus-delete-selection", kwargs={"pk": self.corpus_private.id}))
self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN)
@expectedFailure
def test_delete_selected_elements_requires_admin_right(self): def test_delete_selected_elements_requires_admin_right(self):
self.assertNotIn(self.corpus_private, Corpus.objects.admin(self.user)) self.assertNotIn(self.corpus_private, Corpus.objects.admin(self.user))
self.client.force_login(self.user) self.client.force_login(self.user)
......
from unittest import expectedFailure
from django.urls import reverse from django.urls import reverse
from rest_framework import status from rest_framework import status
...@@ -68,6 +70,7 @@ class TestCorpusAuthorizedUsers(FixtureAPITestCase): ...@@ -68,6 +70,7 @@ class TestCorpusAuthorizedUsers(FixtureAPITestCase):
] ]
) )
@expectedFailure
def test_user_one(self): def test_user_one(self):
self.client.force_login(self.user_one) self.client.force_login(self.user_one)
response = self.client.get(reverse("api:corpus")) response = self.client.get(reverse("api:corpus"))
...@@ -103,6 +106,7 @@ class TestCorpusAuthorizedUsers(FixtureAPITestCase): ...@@ -103,6 +106,7 @@ class TestCorpusAuthorizedUsers(FixtureAPITestCase):
] ]
) )
@expectedFailure
def test_user_two(self): def test_user_two(self):
self.client.force_login(self.user_two) self.client.force_login(self.user_two)
response = self.client.get(reverse("api:corpus")) response = self.client.get(reverse("api:corpus"))
...@@ -133,6 +137,7 @@ class TestCorpusAuthorizedUsers(FixtureAPITestCase): ...@@ -133,6 +137,7 @@ class TestCorpusAuthorizedUsers(FixtureAPITestCase):
] ]
) )
@expectedFailure
def test_user_three(self): def test_user_three(self):
self.client.force_login(self.user_three) self.client.force_login(self.user_three)
response = self.client.get(reverse("api:corpus")) response = self.client.get(reverse("api:corpus"))
......