diff --git a/doccano/app/server/models.py b/doccano/app/server/models.py
index 0a44dbc8..4f74b858 100644
--- a/doccano/app/server/models.py
+++ b/doccano/app/server/models.py
@@ -23,6 +23,9 @@ class Label(models.Model):
'text': self.text,
'shortcut': self.shortcut}
+ def __str__(self):
+ return self.text
+
class Document(models.Model):
text = models.TextField()
@@ -32,6 +35,9 @@ class Document(models.Model):
return {'id': self.id,
'text': self.text}
+ def __str__(self):
+ return self.text[:50]
+
class Annotation(models.Model):
prob = models.FloatField(blank=True, null=True)
@@ -41,7 +47,7 @@ class Annotation(models.Model):
def as_dict(self):
return {'id': self.id,
- 'data_id': self.data.id,
- 'label_id': self.label.id,
+ 'doc': self.data.as_dict(),
+ 'label': self.label.as_dict(),
'prob': self.prob,
'manual': self.manual}
diff --git a/doccano/app/server/templates/project_admin.html b/doccano/app/server/templates/project_admin.html
index 57f7fa15..3cc6a6d8 100644
--- a/doccano/app/server/templates/project_admin.html
+++ b/doccano/app/server/templates/project_admin.html
@@ -106,6 +106,14 @@
+
+
Data Download
+ + + + + Download + diff --git a/doccano/app/server/urls.py b/doccano/app/server/urls.py index 52f0b0c4..5d91e66c 100644 --- a/doccano/app/server/urls.py +++ b/doccano/app/server/urls.py @@ -1,12 +1,13 @@ from django.urls import path from .views import AnnotationView, AnnotationAPIView, ProgressAPI, SearchAPI, InboxView -from .views import ProjectListView, ProjectAdminView, RawDataAPI, LabelAPI +from .views import ProjectListView, ProjectAdminView, RawDataAPI, LabelAPI, DataDownloadAPI urlpatterns = [ path('', ProjectListView.as_view(), name='project-list'), path('