MCPcopy
hub / github.com/tortoise/tortoise-orm / validate_ipv6_address

Function validate_ipv6_address

tortoise/validators.py:133–142  ·  view source on GitHub ↗

A validator to validate whether the given value is valid IPv6Address or not. :raises ValidationError: if value is invalid IPv6Address.

(value: Any)

Source from the content-addressed store, hash-verified

131
132
133def validate_ipv6_address(value: Any) -> None:
134 """
135 A validator to validate whether the given value is valid IPv6Address or not.
136
137 :raises ValidationError: if value is invalid IPv6Address.
138 """
139 try:
140 ipaddress.IPv6Address(value)
141 except ValueError:
142 raise ValidationError(f"'{value}' is not a valid IPv6 address.")
143
144
145def validate_ipv46_address(value: Any) -> None:

Callers 1

validate_ipv46_addressFunction · 0.85

Calls 1

ValidationErrorClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…