clinicedc 2.0.32__py3-none-any.whl → 2.0.34__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.

Potentially problematic release.


This version of clinicedc might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: clinicedc
3
- Version: 2.0.32
3
+ Version: 2.0.34
4
4
  Summary: A clinical trials data management framework built on Django
5
5
  Keywords: django,clinicedc,edc,clinical trials,research,data management,esource
6
6
  Author: Erik van Widenfelt, Jonathan Willitts
@@ -2701,7 +2701,7 @@ edc_pylabels/urls.py,sha256=p8L566pZflE79QYdJUs9YvaOTlvrdzaqvnW9T7PxC44,271
2701
2701
  edc_qareports/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2702
2702
  edc_qareports/admin/__init__.py,sha256=uMV0BL6QaXUXF8-DCY05Js5IAjWmkyPUsUYEQ6gcvp0,159
2703
2703
  edc_qareports/admin/note_modeladmin.py,sha256=VwQOmbF_guL6GF6jQEx4JeccOfqbIkmOyYGngqQ3ozI,439
2704
- edc_qareports/admin/qa_report_log_admin.py,sha256=904nUFb-Q1YUGMrl_LV0PTMDrGlZ6vRTCsmDzE4pnWE,1086
2704
+ edc_qareports/admin/qa_report_log_admin.py,sha256=grjcff_53Ys-w3XSw_-HylrpRDYkdbCDi6b0KFhM2qc,1167
2705
2705
  edc_qareports/admin/qa_report_log_summary_admin.py,sha256=RkUfFt8bPBWNMkM6rLI3Jd7ZqtdzODzZc-kSCh14yWM,1775
2706
2706
  edc_qareports/admin_site.py,sha256=k8Yvg_O20dL__6SiSenzN1zTkNUmqKvUwdhdszC4HPo,171
2707
2707
  edc_qareports/apps.py,sha256=5Zv59kZ9ZSvNDtt2cgKqneZPHFkMPUIXRIaghDrUoco,228
@@ -2739,9 +2739,9 @@ edc_qareports/model_mixins/qa_report_model_mixin.py,sha256=_h3CluFJtUXNtwK9KKWUf
2739
2739
  edc_qareports/model_mixins/qa_reports_permissions.py,sha256=aHJHGBoCZh6BnFbTmAcVVr_KkjlstjN3vIvRYHb-jcc,60
2740
2740
  edc_qareports/modeladmin_mixins/__init__.py,sha256=VAYuotQzLzi1_4LMOGY86fE_QKYrfB4uwOn2V3tkzpA,265
2741
2741
  edc_qareports/modeladmin_mixins/list_filters.py,sha256=xAbbtgLzaCM1sHEtDSMMHIhXp4KmrAIREHcOAloXmnI,2326
2742
- edc_qareports/modeladmin_mixins/note_modeladmin_mixin.py,sha256=MP_o1bJcaeOBvH32DYBpJ-6A05hF8g2h7Fsu0V2JEDI,3099
2742
+ edc_qareports/modeladmin_mixins/note_modeladmin_mixin.py,sha256=jCWOdllQHR84rzRoZr01ejt3BSC_Thdz8WZbGACzYuY,3440
2743
2743
  edc_qareports/modeladmin_mixins/on_study_missing_values_modeladmin_mixin.py,sha256=YM-m7mcARIIy5R_jpTXHJvovccRIt6bYW9obrSTVycM,5310
2744
- edc_qareports/modeladmin_mixins/qa_report_modeladmin_mixin.py,sha256=hI22nUr46WDqzZ32xbYHHlRqryzZFd4dQU-HvirkjUg,4443
2744
+ edc_qareports/modeladmin_mixins/qa_report_modeladmin_mixin.py,sha256=jCR42WCLfLTCMrGULRsfzXZZuYjc2Ql2zOU5shVfv2Y,4455
2745
2745
  edc_qareports/models/__init__.py,sha256=pRuBhzApuoGnrCRXqxJTMuNoCtb19JeXPGNte8sJXy8,147
2746
2746
  edc_qareports/models/dbviews/__init__.py,sha256=wlvpUL50RQg547kNp3OFu-SKxxn72SVZy90XPm5cx4A,48
2747
2747
  edc_qareports/models/dbviews/unmanaged_model.py,sha256=ZixcNynS8LvTjUMu3jGwE8ZSfClSSbsl3g39jPTcEIM,834
@@ -2762,7 +2762,7 @@ edc_qareports/templates/edc_qareports/columns/notes_column.html,sha256=BdBBOV6sH
2762
2762
  edc_qareports/templates/edc_qareports/columns/subject_identifier_column.html,sha256=wiAU6V44fOu21UNPFo7wUyACVJk-S_or5qNc3V7q5Vc,110
2763
2763
  edc_qareports/templates/edc_qareports/qa_report_note.html,sha256=FnHwiHvucF90gnQZzzpCDQMo2OkaX8eIc4apMOqi3gE,57
2764
2764
  edc_qareports/urls.py,sha256=2QK5ajM8JPflnnp-nPybb9n_SxUZF-tzoW0WpcpFFZs,296
2765
- edc_qareports/utils.py,sha256=W7DCEOl2BQrWHUJAWIJikIMy3vxP-6aYOkaumSCFOY4,4208
2765
+ edc_qareports/utils.py,sha256=BB6y79Im6gCLezYTyaoE2Sp5KUgDFFK_dUt87rC6Ubo,3235
2766
2766
  edc_randomization/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2767
2767
  edc_randomization/admin.py,sha256=g9x71IyTXgcrg8dNL_kJ1lSU2asfC-GqlMv62jofFuM,5939
2768
2768
  edc_randomization/admin_site.py,sha256=FC1NwilwEAiUkD8ZrXARElDHugMrzmfL_CPrKR8_MP8,185
@@ -3407,7 +3407,7 @@ edc_vitals/models/fields/waist_circumference.py,sha256=fZcHFDdEwWLjIVLktKrFCD9UU
3407
3407
  edc_vitals/models/fields/weight.py,sha256=zo9_9e3Cpu0UqoRbWS-iDkcDo6fK80b1dDQy4x4MyxE,921
3408
3408
  edc_vitals/utils.py,sha256=vXid44KUXxeaSyund_y5MNXc5DFJs052_PwUAjszE2k,1384
3409
3409
  edc_vitals/validators.py,sha256=vNiElWMs0rRnHRNuVoPLRf0rW_C_0xcfUyep1Y_Si5s,156
3410
- clinicedc-2.0.32.dist-info/licenses/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
3411
- clinicedc-2.0.32.dist-info/WHEEL,sha256=-neZj6nU9KAMg2CnCY6T3w8J53nx1kFGw_9HfoSzM60,79
3412
- clinicedc-2.0.32.dist-info/METADATA,sha256=IdewcHEHsn5lr6e5b3iaGZE2G_Muxe_3IXaJ2cIEXMs,15786
3413
- clinicedc-2.0.32.dist-info/RECORD,,
3410
+ clinicedc-2.0.34.dist-info/licenses/LICENSE,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
3411
+ clinicedc-2.0.34.dist-info/WHEEL,sha256=-neZj6nU9KAMg2CnCY6T3w8J53nx1kFGw_9HfoSzM60,79
3412
+ clinicedc-2.0.34.dist-info/METADATA,sha256=lIEb73iG_SXEPpB5ECYszpk43VWoW-TFbquygAzYRXY,15786
3413
+ clinicedc-2.0.34.dist-info/RECORD,,
@@ -29,5 +29,8 @@ class QaReportLogAdmin(
29
29
 
30
30
  @admin.display(description="Report", ordering="report_model")
31
31
  def report(self, obj=None):
32
- model_cls = django_apps.get_model(obj.report_model)
32
+ try:
33
+ model_cls = django_apps.get_model(obj.report_model)
34
+ except LookupError:
35
+ return obj.report_model
33
36
  return model_cls._meta.verbose_name
@@ -71,22 +71,31 @@ class NoteModelAdminMixin(
71
71
  "user_modified",
72
72
  )
73
73
 
74
- search_fields = ("subject_identifier", "name")
74
+ search_fields = ("subject_identifier", "report_model")
75
75
 
76
- @admin.display(description="Report", ordering="report_name")
76
+ @admin.display(description="Report", ordering="report_model")
77
77
  def report(self, obj=None):
78
- app_label, model = obj.report_model_cls._meta.label_lower.split(".")
79
- changelist_url = "_".join([app_label, model, "changelist"])
80
78
  try:
81
- # assume admin site naming convention
82
- url = reverse(f"{app_label}_admin:{changelist_url}")
83
- except NoReverseMatch:
84
- # TODO: find the admin site where this model is registered
85
- url = "#"
86
- return format_html(
87
- '<a data-toggle="tooltip" title="go to report" href="{}?q={}">{}</a>',
88
- *(url, obj.subject_identifier, obj.report_model_cls._meta.verbose_name),
89
- )
79
+ app_label, model = obj.report_model_cls._meta.label_lower.split(".")
80
+ except (LookupError, ValueError):
81
+ pass
82
+ else:
83
+ changelist_url = "_".join([app_label, model, "changelist"])
84
+ try:
85
+ # assume admin site naming convention
86
+ url = reverse(f"{app_label}_admin:{changelist_url}")
87
+ except NoReverseMatch:
88
+ # TODO: find the admin site where this model is registered
89
+ pass
90
+ else:
91
+ return format_html(
92
+ '<a data-toggle="tooltip" title="go to report" href='
93
+ '"{url}?q={subject_identifier}">{report_model_cls}</a>',
94
+ url=url,
95
+ subject_identifier=obj.subject_identifier,
96
+ report_model_cls=obj.report_model_cls._meta.verbose_name,
97
+ )
98
+ return obj.report_model
90
99
 
91
100
  @admin.display(description="QA Note", ordering="note")
92
101
  def report_note(self, obj=None):
@@ -102,7 +102,7 @@ class QaReportModelAdminMixin:
102
102
  url = (
103
103
  f"{url}?next={next_url_name},subject_identifier,q"
104
104
  f"&subject_identifier={obj.subject_identifier}"
105
- f"&report_model={obj.report_model}&q={obj.subject_identifier}"
105
+ f"&report_model={self.model._meta.label_lower}&q={obj.subject_identifier}"
106
106
  )
107
107
  label = self.get_notes_label(note_model_obj)
108
108
  context = dict(title=title, url=url, label=label)
edc_qareports/utils.py CHANGED
@@ -1,6 +1,5 @@
1
1
  import contextlib
2
2
  import sys
3
- from pathlib import Path
4
3
  from warnings import warn
5
4
 
6
5
  from django.apps import apps as django_apps
@@ -10,35 +9,6 @@ from django.db import OperationalError, connection
10
9
  from edc_auth.get_app_codenames import get_app_codenames
11
10
 
12
11
 
13
- def read_unmanaged_model_sql(
14
- filename: str | None = None,
15
- app_name: str | None = None,
16
- fullpath: str | Path | None = None,
17
- ) -> str:
18
- """Wait, use DBView instead!!"""
19
- uuid_func = "uuid()"
20
- if settings.DATABASES["default"]["ENGINE"] == "django.db.backends.postgresql":
21
- uuid_func = "gen_random_uuid()"
22
-
23
- if not fullpath:
24
- fullpath = Path(settings.BASE_DIR) / app_name / "models" / "unmanaged" / filename
25
- else:
26
- fullpath = Path(fullpath)
27
-
28
- parsed_sql = []
29
- with fullpath.open("r") as f:
30
- for line in f:
31
- line = line.split("#", maxsplit=1)[0] # noqa: PLW2901
32
- line = line.split("-- ", maxsplit=1)[0] # noqa: PLW2901
33
- line = line.replace("\n", "") # noqa: PLW2901
34
- line = line.strip() # noqa: PLW2901
35
- if line:
36
- parsed_sql.append(line)
37
-
38
- sql = " ".join(parsed_sql)
39
- return sql.replace("uuid()", uuid_func)
40
-
41
-
42
12
  def get_qareports_codenames(app_name: str, *note_models: str) -> list[str]:
43
13
  warn(
44
14
  "This function has been deprecated. Use get_app_codenames.",