django-transcribe 0.7.0__py3-none-any.whl → 0.8.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {django_transcribe-0.7.0.dist-info → django_transcribe-0.8.0.dist-info}/METADATA +1 -1
- {django_transcribe-0.7.0.dist-info → django_transcribe-0.8.0.dist-info}/RECORD +10 -10
- {django_transcribe-0.7.0.dist-info → django_transcribe-0.8.0.dist-info}/WHEEL +1 -1
- transcribe/__init__.py +1 -1
- transcribe/admin.py +12 -3
- transcribe/models.py +8 -10
- transcribe/views/web.py +2 -1
- {django_transcribe-0.7.0.dist-info → django_transcribe-0.8.0.dist-info}/AUTHORS +0 -0
- {django_transcribe-0.7.0.dist-info → django_transcribe-0.8.0.dist-info}/LICENSE +0 -0
- {django_transcribe-0.7.0.dist-info → django_transcribe-0.8.0.dist-info}/top_level.txt +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
transcribe/__init__.py,sha256=
|
|
2
|
-
transcribe/admin.py,sha256=
|
|
1
|
+
transcribe/__init__.py,sha256=ImF9MiNHXiXNij30OnrUoNFX56QIW5ho0CDmr3s5FVo,78
|
|
2
|
+
transcribe/admin.py,sha256=qPLL0XNzK0abIRBVRtjQq8SaEK2gzb_yyshafbxk9B4,6766
|
|
3
3
|
transcribe/api.py,sha256=2m_y44ilQh87CWksHHqiE4A14javR8omlXEXm65lmC4,74
|
|
4
4
|
transcribe/apps.py,sha256=XUdPQkCjpqWAKDCIaE6Mh8Q4xN5upKv95MG1u2_5pig,246
|
|
5
5
|
transcribe/diff_match_patch.py,sha256=HZC5DNab5OVwbB4Zc7G17l1OHbBlH2g9-xOtT1zkQ1A,84937
|
|
6
6
|
transcribe/filters.py,sha256=_ANh6XGDXgmD_wxQo5IPReQsv3_MDqThOwB06LKfbac,1264
|
|
7
7
|
transcribe/forms.py,sha256=6j-MtheDtDeBo9B_hlKhkWkWkKVJsLrJIlSsZAlB7ic,5612
|
|
8
8
|
transcribe/middleware.py,sha256=3SvvNmJMlVohD_4Liv1yT3hc_nudpvt2giAE7Wt9rx4,485
|
|
9
|
-
transcribe/models.py,sha256=
|
|
9
|
+
transcribe/models.py,sha256=mcAs_mwX2ROgB5OjlY2ceu_yL34nr4K5wiRrPz3XCf8,38870
|
|
10
10
|
transcribe/settings.py,sha256=TNRFJstZF9X3l5qZSzv3xcrEuPMmOQbB-59mqADn9Dk,569
|
|
11
11
|
transcribe/signals.py,sha256=pvRSWobg__Jw5ZvlFBZZAw3rDk1dvVyiq8Ka2lBGeSY,1105
|
|
12
12
|
transcribe/urls.py,sha256=xgTkOdeC1cWmQAMzAp-VRwvmwyEAfEabncGgHyZiAL0,2040
|
|
@@ -142,10 +142,10 @@ transcribe/templates/transcribe/xsl/tei-html.xsl,sha256=oOVnAZhDVDVzrQR5UEbNV-97
|
|
|
142
142
|
transcribe/views/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
143
143
|
transcribe/views/mixins.py,sha256=QmFDhWb5VCEaGatLdbsTK72jiBG2OKrlncnz79FUmto,2727
|
|
144
144
|
transcribe/views/reports.py,sha256=7YD5E6CPsIfWP8hG8IFTek29cM2T29NHuowAdlTAyBs,13408
|
|
145
|
-
transcribe/views/web.py,sha256=
|
|
146
|
-
django_transcribe-0.
|
|
147
|
-
django_transcribe-0.
|
|
148
|
-
django_transcribe-0.
|
|
149
|
-
django_transcribe-0.
|
|
150
|
-
django_transcribe-0.
|
|
151
|
-
django_transcribe-0.
|
|
145
|
+
transcribe/views/web.py,sha256=WoVs-iwYc2hesuBxCmwfo-wza15C1fiMRY6S0TAdxQs,15213
|
|
146
|
+
django_transcribe-0.8.0.dist-info/AUTHORS,sha256=rNmFConshTlNpyhcu4CKZSeQQMwuyVYXbeqXgRko-Yc,640
|
|
147
|
+
django_transcribe-0.8.0.dist-info/LICENSE,sha256=I9xp13yeayqZikrv7rQrzsDWviTwy1R0phFlKtM1meg,1472
|
|
148
|
+
django_transcribe-0.8.0.dist-info/METADATA,sha256=aOVYGiqY0N9n0R5JfnLRelfe91r8odmqIVHdiM5Dc80,1021
|
|
149
|
+
django_transcribe-0.8.0.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
|
|
150
|
+
django_transcribe-0.8.0.dist-info/top_level.txt,sha256=NljSay7zO6czcjqjVmivw6VW58aXlYHVZQvnwmpy08g,11
|
|
151
|
+
django_transcribe-0.8.0.dist-info/RECORD,,
|
transcribe/__init__.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
default_app_config = 'transcribe.apps.transcribeConfig'
|
|
2
|
-
__version__ = '0.
|
|
2
|
+
__version__ = '0.8.0'
|
transcribe/admin.py
CHANGED
|
@@ -3,7 +3,7 @@ import logging
|
|
|
3
3
|
|
|
4
4
|
from django.contrib import admin
|
|
5
5
|
from django.db.models import Count
|
|
6
|
-
from django.shortcuts import resolve_url
|
|
6
|
+
from django.shortcuts import resolve_url, reverse
|
|
7
7
|
from django.utils.html import format_html
|
|
8
8
|
|
|
9
9
|
from . import filters, forms, models
|
|
@@ -14,11 +14,11 @@ log = logging.getLogger(__name__)
|
|
|
14
14
|
@admin.register(models.UserTask)
|
|
15
15
|
class UserTaskAdmin(admin.ModelAdmin):
|
|
16
16
|
list_display = (
|
|
17
|
-
'
|
|
17
|
+
'user_admin_display_name',
|
|
18
|
+
'task_link',
|
|
18
19
|
'status',
|
|
19
20
|
'task_type',
|
|
20
21
|
'project_link',
|
|
21
|
-
'user_admin_display_name',
|
|
22
22
|
'modified',
|
|
23
23
|
)
|
|
24
24
|
search_fields = (
|
|
@@ -45,6 +45,15 @@ class UserTaskAdmin(admin.ModelAdmin):
|
|
|
45
45
|
filters.TaskFilterForUserTask,
|
|
46
46
|
]
|
|
47
47
|
|
|
48
|
+
def task_link(self, obj):
|
|
49
|
+
return format_html(
|
|
50
|
+
'<a href="{}">{}</a>',
|
|
51
|
+
reverse('admin:transcribe_usertask_change', args=[obj.pk]),
|
|
52
|
+
obj.task,
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
task_link.short_description = 'Task'
|
|
56
|
+
|
|
48
57
|
def file_link(self, obj):
|
|
49
58
|
if obj.task.file:
|
|
50
59
|
return format_html(
|
transcribe/models.py
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
"""Models for transcribe."""
|
|
2
2
|
import logging
|
|
3
3
|
import re
|
|
4
|
-
from datetime import
|
|
4
|
+
from datetime import timedelta
|
|
5
5
|
from os import path
|
|
6
6
|
|
|
7
7
|
from django.contrib.auth import get_user_model
|
|
8
8
|
from django.db import models
|
|
9
9
|
from django.db.models import Count, Q
|
|
10
10
|
from django.urls import reverse
|
|
11
|
+
from django.utils import timezone
|
|
11
12
|
from django.utils.functional import cached_property
|
|
12
13
|
from django.utils.html import format_html, strip_tags
|
|
13
14
|
from model_utils import Choices
|
|
14
15
|
from model_utils.models import TimeStampedModel
|
|
16
|
+
|
|
15
17
|
from transcribe import settings
|
|
16
18
|
from transcribe.diff_match_patch import diff_match_patch
|
|
17
19
|
from transcribe.utils import html_diffs, remove_markup
|
|
@@ -408,8 +410,7 @@ class Project(TimeStampedModel):
|
|
|
408
410
|
|
|
409
411
|
@cached_property
|
|
410
412
|
def percent_done(self):
|
|
411
|
-
"""Returns an integer indicating the percent complete for the project.
|
|
412
|
-
"""
|
|
413
|
+
"""Returns an integer indicating the percent complete for the project."""
|
|
413
414
|
counts = Task.objects.filter(project_id=self.pk).aggregate(
|
|
414
415
|
total_tasks=Count('id'),
|
|
415
416
|
finished_review_tasks=Count('id', filter=Q(finished_review=1)),
|
|
@@ -487,9 +488,7 @@ class Project(TimeStampedModel):
|
|
|
487
488
|
# exclude tasks that:
|
|
488
489
|
# - have enough user tasks in progress AND
|
|
489
490
|
# - those user tasks are not too old (expired)
|
|
490
|
-
expired_dt = (
|
|
491
|
-
datetime.today() - timedelta(days=settings.TASK_EXPIRE_DAYS)
|
|
492
|
-
).strftime('%Y-%m-%d %H:%M:%S')
|
|
491
|
+
expired_dt = timezone.now() - timedelta(days=settings.TASK_EXPIRE_DAYS)
|
|
493
492
|
task_ids_to_exclude.update(
|
|
494
493
|
self.tasks.defer('transcription')
|
|
495
494
|
.filter(
|
|
@@ -557,9 +556,7 @@ class Project(TimeStampedModel):
|
|
|
557
556
|
).values_list('id', flat=True)
|
|
558
557
|
|
|
559
558
|
# in progress tasks that are recent
|
|
560
|
-
expired_dt = (
|
|
561
|
-
datetime.today() - timedelta(days=settings.TASK_EXPIRE_DAYS)
|
|
562
|
-
).strftime('%Y-%m-%d %H:%M:%S')
|
|
559
|
+
expired_dt = timezone.now() - timedelta(days=settings.TASK_EXPIRE_DAYS)
|
|
563
560
|
task_ids_already_being_reviewed = self.tasks.filter(
|
|
564
561
|
usertasks__status='in progress',
|
|
565
562
|
usertasks__task_type='review',
|
|
@@ -698,9 +695,10 @@ class Project(TimeStampedModel):
|
|
|
698
695
|
|
|
699
696
|
def generate_html(self):
|
|
700
697
|
"""Generates and returns an HTML representation of the project."""
|
|
701
|
-
from lxml import etree
|
|
702
698
|
import tempfile
|
|
703
699
|
|
|
700
|
+
from lxml import etree
|
|
701
|
+
|
|
704
702
|
xml = self.generate_xml()
|
|
705
703
|
html = ''
|
|
706
704
|
temp = tempfile.NamedTemporaryFile(mode='w+t', delete=False)
|
transcribe/views/web.py
CHANGED
|
@@ -10,6 +10,7 @@ from django.views.generic import View
|
|
|
10
10
|
from django.views.generic.detail import DetailView
|
|
11
11
|
from django.views.generic.edit import UpdateView
|
|
12
12
|
from django.views.generic.list import ListView
|
|
13
|
+
|
|
13
14
|
from transcribe import models, settings
|
|
14
15
|
from transcribe.views import mixins
|
|
15
16
|
|
|
@@ -19,7 +20,7 @@ log = logging.getLogger(__name__)
|
|
|
19
20
|
def get_project_with_tasks(project, user):
|
|
20
21
|
"""Return project with transcription and review tasks attached."""
|
|
21
22
|
if not isinstance(user, models.TranscribeUser):
|
|
22
|
-
user = models.TranscribeUser.objects.get(
|
|
23
|
+
user = models.TranscribeUser.objects.get(user=user)
|
|
23
24
|
project.pending_trans_task = project.pending_transcription_task(user)
|
|
24
25
|
project.avail_trans_task = False
|
|
25
26
|
if not project.pending_trans_task:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|