From da579fa6ec8576eaf3db695c748be4c50a74b79c Mon Sep 17 00:00:00 2001 From: "Jens W. Klein" Date: Wed, 11 Dec 2024 16:42:01 +0100 Subject: [PATCH] move ObjectWithClassReference --- src/edutap/wallet_google/api.py | 2 +- src/edutap/wallet_google/models/misc.py | 8 ++++++++ src/edutap/wallet_google/models/passes/bases.py | 9 --------- src/edutap/wallet_google/registry.py | 1 + 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/edutap/wallet_google/api.py b/src/edutap/wallet_google/api.py index 67bb2f5..1287ae9 100644 --- a/src/edutap/wallet_google/api.py +++ b/src/edutap/wallet_google/api.py @@ -2,7 +2,7 @@ from .models.datatypes.general import Pagination from .models.datatypes.message import Message from .models.misc import AddMessageRequest -from .models.passes.bases import ObjectWithClassReference +from .models.misc import ObjectWithClassReference from .registry import lookup_metadata from .registry import lookup_model from .registry import lookup_model_by_plural_name diff --git a/src/edutap/wallet_google/models/misc.py b/src/edutap/wallet_google/models/misc.py index 5dc99cb..80f51d4 100644 --- a/src/edutap/wallet_google/models/misc.py +++ b/src/edutap/wallet_google/models/misc.py @@ -15,6 +15,14 @@ from .passes import retail from .passes import tickets_and_transit +class ObjectWithClassReference(WithIdModel): + """ + + Google Wallet Object with a classReferences attribute, that reflects the whole class data. + This class is used to create the save_link only, never inherit from it. + """ + + classReference: ClassModel | None = None @register_model( "SmartTap", diff --git a/src/edutap/wallet_google/models/passes/bases.py b/src/edutap/wallet_google/models/passes/bases.py index 2a5e212..92260b0 100644 --- a/src/edutap/wallet_google/models/passes/bases.py +++ b/src/edutap/wallet_google/models/passes/bases.py @@ -110,15 +110,6 @@ class ObjectModel(WithIdModel): validTimeInterval: TimeInterval | None = None -class ObjectWithClassReference(WithIdModel): - """ - Mixin for all Google Wallet Object with a classReferences attribute, that reflects the whole class data. - This class is used to create the save_link only, never inherit from it. - """ - - classReference: ClassModel | None = None - - class StyleableMixin: """ Mixin for Google Wallet Classes/Objects that can be styled. diff --git a/src/edutap/wallet_google/registry.py b/src/edutap/wallet_google/registry.py index cce2a7c..f21d804 100644 --- a/src/edutap/wallet_google/registry.py +++ b/src/edutap/wallet_google/registry.py @@ -5,6 +5,7 @@ class RegistryMetadataDict(TypedDict, total=False): + """TypedDict for the metadata of a registered model.""" model: type[Model] name: str url_part: str