generated from MinBZK/python-project-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2b0ce4b
commit a8751d6
Showing
14 changed files
with
117 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from collections.abc import Callable | ||
|
||
from fastapi import Request | ||
|
||
from ..schema.localized_value_item import LocalizedValueItem | ||
from .localizable import LocalizableEnum, get_localized_enum, get_localized_enums | ||
|
||
|
||
class RiskGroup(LocalizableEnum): | ||
hoog_risico_ai = "hoog-risico AI" | ||
geen_hoog_risico_ai = "geen hoog-risico AI" | ||
verboden_ai = "verboden AI" | ||
uitzondering_van_toepassing = "uitzondering van toepassing" | ||
niet_van_toepassing = "niet van toepassing" | ||
|
||
@classmethod | ||
def get_display_values(cls: type["RiskGroup"], _: Callable[[str], str]) -> dict["RiskGroup", str]: | ||
return { | ||
cls.hoog_risico_ai: _("high-risk AI"), | ||
cls.geen_hoog_risico_ai: _("No high-risk AI"), | ||
cls.verboden_ai: _("Forbidden AI"), | ||
cls.uitzondering_van_toepassing: _("Exception of application"), | ||
cls.niet_van_toepassing: _("Not applicable"), | ||
} | ||
|
||
|
||
def get_localized_risk_group(key: RiskGroup | None, request: Request) -> LocalizedValueItem | None: | ||
return get_localized_enum(key, request) | ||
|
||
|
||
def get_localized_risk_groups(request: Request) -> list[LocalizedValueItem | None]: | ||
return get_localized_enums(RiskGroup, request) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.