File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44from .caching import CachedEndpointMixin , CacheMixin
55from .get import FilterGetEndpointMixin , PathGetEndpointMixin
66from .list import ListEndpointMixin
7- from .params import KeyErrorPopStudyKeyMixin , ParamMixin
7+ from .params import ParamMixin
88from .parsing import ParsingMixin
99
1010__all__ = [
1111 "AsyncPaginator" ,
1212 "CachedEndpointMixin" ,
1313 "CacheMixin" ,
1414 "FilterGetEndpointMixin" ,
15- "KeyErrorPopStudyKeyMixin" ,
1615 "ListEndpointMixin" ,
1716 "Paginator" ,
1817 "ParamMixin" ,
Original file line number Diff line number Diff line change 66 DefaultParamProcessor ,
77 KeepStudyKeyStrategy ,
88 OptionalStudyKeyStrategy ,
9- PopStudyKeyStrategy ,
109 StudyKeyStrategy ,
1110)
1211from imednet .core .endpoint .structs import ParamState
@@ -91,9 +90,3 @@ def _resolve_params(
9190 params .update (extra_params )
9291
9392 return ParamState (study = study , params = params , other_filters = other_filters )
94-
95-
96- class KeyErrorPopStudyKeyMixin :
97- """Mixin that configures the endpoint to pop the study key and raise KeyError if missing."""
98-
99- STUDY_KEY_STRATEGY : Optional [StudyKeyStrategy ] = PopStudyKeyStrategy (exception_cls = KeyError )
Original file line number Diff line number Diff line change 22
33from imednet .core .endpoint .base import GenericListGetEndpoint
44from imednet .core .endpoint .edc_mixin import EdcEndpointMixin
5- from imednet .core .endpoint .mixins import KeyErrorPopStudyKeyMixin
5+ from imednet .core .endpoint .strategies import PopStudyKeyStrategy
66from imednet .models .codings import Coding
77
88
99class CodingsEndpoint (
1010 EdcEndpointMixin ,
11- KeyErrorPopStudyKeyMixin ,
1211 GenericListGetEndpoint [Coding ],
1312):
1413 """
@@ -20,3 +19,4 @@ class CodingsEndpoint(
2019 PATH = "codings"
2120 MODEL = Coding
2221 _id_param = "codingId"
22+ STUDY_KEY_STRATEGY = PopStudyKeyStrategy (exception_cls = KeyError )
Original file line number Diff line number Diff line change 22
33from imednet .core .endpoint .base import GenericListGetEndpoint
44from imednet .core .endpoint .edc_mixin import EdcEndpointMixin
5- from imednet .core .endpoint .mixins import CachedEndpointMixin , KeyErrorPopStudyKeyMixin
5+ from imednet .core .endpoint .mixins import CachedEndpointMixin
6+ from imednet .core .endpoint .strategies import PopStudyKeyStrategy
67from imednet .models .forms import Form
78
89
910class FormsEndpoint (
1011 EdcEndpointMixin ,
11- KeyErrorPopStudyKeyMixin ,
1212 CachedEndpointMixin ,
1313 GenericListGetEndpoint [Form ],
1414):
@@ -21,3 +21,4 @@ class FormsEndpoint(
2121 PATH = "forms"
2222 MODEL = Form
2323 _id_param = "formId"
24+ STUDY_KEY_STRATEGY = PopStudyKeyStrategy (exception_cls = KeyError )
Original file line number Diff line number Diff line change 22
33from imednet .core .endpoint .base import GenericListGetEndpoint
44from imednet .core .endpoint .edc_mixin import EdcEndpointMixin
5- from imednet .core .endpoint .mixins import CachedEndpointMixin , KeyErrorPopStudyKeyMixin
5+ from imednet .core .endpoint .mixins import CachedEndpointMixin
6+ from imednet .core .endpoint .strategies import PopStudyKeyStrategy
67from imednet .models .intervals import Interval
78
89
910class IntervalsEndpoint (
1011 EdcEndpointMixin ,
11- KeyErrorPopStudyKeyMixin ,
1212 CachedEndpointMixin ,
1313 GenericListGetEndpoint [Interval ],
1414):
@@ -21,3 +21,4 @@ class IntervalsEndpoint(
2121 PATH = "intervals"
2222 MODEL = Interval
2323 _id_param = "intervalId"
24+ STUDY_KEY_STRATEGY = PopStudyKeyStrategy (exception_cls = KeyError )
Original file line number Diff line number Diff line change 22
33from imednet .core .endpoint .base import GenericListGetEndpoint
44from imednet .core .endpoint .edc_mixin import EdcEndpointMixin
5- from imednet .core .endpoint .mixins import KeyErrorPopStudyKeyMixin
5+ from imednet .core .endpoint .strategies import PopStudyKeyStrategy
66from imednet .models .sites import Site
77
88
99class SitesEndpoint (
1010 EdcEndpointMixin ,
11- KeyErrorPopStudyKeyMixin ,
1211 GenericListGetEndpoint [Site ],
1312):
1413 """
@@ -20,3 +19,4 @@ class SitesEndpoint(
2019 PATH = "sites"
2120 MODEL = Site
2221 _id_param = "siteId"
22+ STUDY_KEY_STRATEGY = PopStudyKeyStrategy (exception_cls = KeyError )
Original file line number Diff line number Diff line change 22
33from imednet .core .endpoint .base import GenericListGetEndpoint
44from imednet .core .endpoint .edc_mixin import EdcEndpointMixin
5- from imednet .core .endpoint .mixins import CachedEndpointMixin , KeyErrorPopStudyKeyMixin
5+ from imednet .core .endpoint .mixins import CachedEndpointMixin
6+ from imednet .core .endpoint .strategies import PopStudyKeyStrategy
67from imednet .models .variables import Variable
78
89
910class VariablesEndpoint (
1011 EdcEndpointMixin ,
11- KeyErrorPopStudyKeyMixin ,
1212 CachedEndpointMixin ,
1313 GenericListGetEndpoint [Variable ],
1414):
@@ -21,3 +21,4 @@ class VariablesEndpoint(
2121 PATH = "variables"
2222 MODEL = Variable
2323 _id_param = "variableId"
24+ STUDY_KEY_STRATEGY = PopStudyKeyStrategy (exception_cls = KeyError )
You can’t perform that action at this time.
0 commit comments