Skip to content

Commit

Permalink
Reuse HeaderEntry as typed dict
Browse files Browse the repository at this point in the history
  • Loading branch information
r-peschke committed Sep 21, 2023
1 parent 75b412f commit 5b59166
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions openslides_backend/action/mixins/import_mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
from decimal import Decimal
from enum import Enum
from time import mktime, strptime, time
from typing import Any, Callable, Dict, List, Optional, Tuple, TypedDict, Union, cast
from typing import Any, Callable, Dict, List, Optional, Tuple, Union, cast
from typing_extensions import NotRequired, TypedDict

from ...shared.exceptions import ActionException
from ...shared.filters import And, Filter, FilterOperator, Or
Expand Down Expand Up @@ -248,13 +249,19 @@ def on_success() -> None:
return on_success


class HeaderEntry(TypedDict):
property: str
type: str
is_object: NotRequired[bool]


class StatisticEntry(TypedDict):
name: str
value: int


class JsonUploadMixin(BaseImportJsonUpload):
headers: List[Dict[str, Any]]
headers: List[HeaderEntry]
rows: List[Dict[str, Any]]
statistics: List[StatisticEntry]
import_state: ImportState
Expand Down

0 comments on commit 5b59166

Please sign in to comment.