Loading src/coliverter/certifications/AwarenessCertification.py 0 → 100644 +20 −0 Original line number Diff line number Diff line from dataclasses import dataclass from typing import ClassVar from pdf_generator.commitment_certification.Certification import Certification from pdf_generator.jinja.templates import fill_template from babel.core import Locale from coliverter.resources.templates.get_template import get_template @dataclass(frozen=True) class AwarenessCertification(Certification): required_office_kind_name: ClassVar[str] = "Awareness" def html(self, locale: Locale) -> str: return fill_template( get_template("commitment_certification/awareness", locale), locale, certification=self, ) src/coliverter/certifications/from_dict.py +2 −1 Original line number Diff line number Diff line from collections.abc import Mapping from typing import Any, get_args from coliverter.certifications.AwarenessCertification import AwarenessCertification from coliverter.certifications.FachschaftCertification import FachschaftCertification # The types of certification the coliverter can produce type ColiCertification = FachschaftCertification type ColiCertification = FachschaftCertification | AwarenessCertification certification_classes: Mapping[str, type[ColiCertification]] = { cls.required_office_kind_name: cls Loading Loading
src/coliverter/certifications/AwarenessCertification.py 0 → 100644 +20 −0 Original line number Diff line number Diff line from dataclasses import dataclass from typing import ClassVar from pdf_generator.commitment_certification.Certification import Certification from pdf_generator.jinja.templates import fill_template from babel.core import Locale from coliverter.resources.templates.get_template import get_template @dataclass(frozen=True) class AwarenessCertification(Certification): required_office_kind_name: ClassVar[str] = "Awareness" def html(self, locale: Locale) -> str: return fill_template( get_template("commitment_certification/awareness", locale), locale, certification=self, )
src/coliverter/certifications/from_dict.py +2 −1 Original line number Diff line number Diff line from collections.abc import Mapping from typing import Any, get_args from coliverter.certifications.AwarenessCertification import AwarenessCertification from coliverter.certifications.FachschaftCertification import FachschaftCertification # The types of certification the coliverter can produce type ColiCertification = FachschaftCertification type ColiCertification = FachschaftCertification | AwarenessCertification certification_classes: Mapping[str, type[ColiCertification]] = { cls.required_office_kind_name: cls Loading