ip_address_validators
Depending on the given parameters, return the appropriate validators for the GenericIPAddressField.
def ip_address_validators(
protocol: string,
unpack_ipv4: boolean
) - > list
Depending on the given parameters, return the appropriate validators for the GenericIPAddressField.
Parameters
| Name | Type | Description |
|---|---|---|
| protocol | string | The IP protocol version to validate against; must be 'ipv4', 'ipv6', or 'both' |
| unpack_ipv4 | boolean | A flag indicating whether to decode IPv4-mapped IPv6 addresses; only permitted when protocol is set to 'both' |
Returns
| Type | Description |
|---|---|
list | A list of validator functions corresponding to the specified IP protocol |