소스 검색

do not think about this one, __pydantic_validate_values__ is the guy who determines subfield validation

Khaleel Al-Adhami 2 주 전
부모
커밋
2d54ac6a8a
1개의 변경된 파일15개의 추가작업 그리고 0개의 파일을 삭제
  1. 15 0
      reflex/vars/base.py

+ 15 - 0
reflex/vars/base.py

@@ -1310,6 +1310,21 @@ class Var(Generic[VAR_TYPE]):
 
     if not TYPE_CHECKING:
 
+        def __getattribute__(self, name: str):
+            """Get an attribute of the var.
+
+            Args:
+                name: The name of the attribute.
+
+            Returns:
+                The attribute of the var.
+
+            # noqa: DAR101 self
+            """
+            if name == "__pydantic_validate_values__":
+                return lambda *args, **kwargs: None
+            return super().__getattribute__(name)
+
         def __getitem__(self, key: Any) -> Var:
             """Get the item from the var.