Add MyFlightBook importer

This commit is contained in:
april
2024-01-18 13:08:23 -06:00
parent c59bf2fcc9
commit 9790ecf5f6
5 changed files with 90 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
import datetime
from typing import Optional, Dict, Union, List
from typing import Optional, Dict, Union, List, get_args
from utils import to_objectid
from pydantic import BaseModel
@@ -123,6 +123,10 @@ class FlightConciseSchema(BaseModel):
FlightByDateSchema = Dict[int, Union[Dict[int, 'FlightByDateSchema'], FlightConciseSchema]]
fs_keys = list(FlightPatchSchema.__annotations__.keys()) + list(FlightDisplaySchema.__annotations__.keys())
fs_types = {label: get_args(type_)[0] if get_args(type_) else str(type_) for label, type_ in
FlightSchema.__annotations__.items() if len(get_args(type_)) > 0}
# HELPERS #