Skip to content
Snippets Groups Projects
Commit 0fc4a406 authored by Yakubov, Sergey's avatar Yakubov, Sergey
Browse files

add logger

parent f2ab1419
No related branches found
No related tags found
1 merge request!6Update library to work with Pydantic models
Pipeline #640843 waiting for manual action
[tool.poetry]
name = "mvvm-lib"
version = "0.3.1"
version = "0.4.0"
description = "A Python Package for Model-View-ViewModel pattern"
authors = ["Yakubov, Sergey <yakubovs@ornl.gov>"]
readme = "README.md"
......
"""Pydantic utils."""
import logging
import re
from typing import Any
......@@ -8,6 +9,8 @@ from pydantic.fields import FieldInfo
from mvvm_lib import bindings_map
logger = logging.getLogger(__name__)
def get_nested_pydantic_field(model: BaseModel, field_path: str) -> FieldInfo:
"""
......@@ -44,7 +47,7 @@ def get_field_info(field_name: str) -> FieldInfo:
def validate_pydantic_parameter(name: str, value: Any, index: int) -> str | None:
if name not in bindings_map:
print(f"cannot find {name} in bindings_map") # no error, just do not validate for now
logger.warning(f"cannot find {name} in bindings_map") # no error, just do not validate for now
return None
binding = bindings_map[name]
current_model = binding.viewmodel_linked_object
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment