ソースを参照

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

Khaleel Al-Adhami 6 日 前
コミット
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:
     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:
         def __getitem__(self, key: Any) -> Var:
             """Get the item from the var.
             """Get the item from the var.