We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
exclude
1 parent 2863b52 commit b2c1f53Copy full SHA for b2c1f53
1 file changed
tests/test_pydantic/test_field.py
@@ -54,3 +54,16 @@ class Model(SQLModel):
54
55
instance = Model(id=123, foo="bar")
56
assert "foo=" not in repr(instance)
57
+
58
59
+def test_exclude():
60
+ class Model(SQLModel):
61
+ id: int
62
+ name: str
63
+ value: int = Field(exclude=True)
64
65
+ instance = Model(id=1, name="test", value=42)
66
+ dict_representation = instance.model_dump()
67
+ assert "id" in dict_representation
68
+ assert "name" in dict_representation
69
+ assert "value" not in dict_representation
0 commit comments