Support pydantic.networks.IPvAnyAddress
#1617
-
First Check
Commit to Help
Example Codeimport sqlmodel
import pydantic
class Something(sqlmodel.SQLModel, table=True):
ip: pydantic.IPvAnyAddressDescriptionsee: title I'm pretty sure it is a relatively trivial addition and PR, but I'm just asking here: is there any reason why IPv4 and IPv6 Network/Address are added to the type converter, but IPvAny isn't? Relevant lines in the Pydantic -> SQLAlchemy type converter are shown below with context: Lines 664 to 676 in c60cf86 Operating SystemmacOS Operating System DetailsNo response SQLModel Version0.0.27 Python Version3.14 Additional ContextNo response |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
And, SQLModel doesn't currently support unions (only Optional-like unions like See similar discussion that provides the solution: #847 |
Beta Was this translation helpful? Give feedback.
IPvAnyAddressTypeis a type alias forIPv4Address | IPv6Address: https://github.com/pydantic/pydantic/blob/06448aa41764d0c1e1c2f9455b108c4b21012929/pydantic/networks.py#L1094And, SQLModel doesn't currently support unions (only Optional-like unions like
Union[SomeType, None]are supported).See similar discussion that provides the solution: #847