@@ -156,6 +156,7 @@ def is_email(instance):
156156
157157_ipv4_re = re .compile (r"^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$" )
158158
159+
159160@_checks_drafts (draft3 = "ip-address" , draft4 = "ipv4" )
160161def is_ipv4 (instance ):
161162 if not isinstance (instance , str_types ):
@@ -175,6 +176,7 @@ def is_ipv6(instance):
175176
176177_host_name_re = re .compile (r"^[A-Za-z0-9][A-Za-z0-9\.\-]{1,255}$" )
177178
179+
178180@_checks_drafts (draft3 = "host-name" , draft4 = "hostname" )
179181def is_host_name (instance ):
180182 if not isinstance (instance , str_types ):
@@ -209,13 +211,13 @@ def is_uri(instance):
209211 pass
210212 else :
211213 @_checks_drafts ("date-time" , raises = (ValueError , isodate .ISO8601Error ))
212- def is_date (instance ):
214+ def is_datetime (instance ):
213215 if not isinstance (instance , str_types ):
214216 return True
215217 return isodate .parse_datetime (instance )
216218else :
217219 @_checks_drafts ("date-time" )
218- def is_date (instance ):
220+ def is_datetime (instance ):
219221 if not isinstance (instance , str_types ):
220222 return True
221223 return strict_rfc3339 .validate_rfc3339 (instance )
@@ -250,7 +252,6 @@ def is_time(instance):
250252 def is_css_color_code (instance ):
251253 return webcolors .normalize_hex (instance )
252254
253-
254255 @_checks_drafts (draft3 = "color" , raises = (ValueError , TypeError ))
255256 def is_css21_color (instance ):
256257 if (
@@ -260,7 +261,6 @@ def is_css21_color(instance):
260261 return True
261262 return is_css_color_code (instance )
262263
263-
264264 def is_css3_color (instance ):
265265 if instance .lower () in webcolors .css3_names_to_hex :
266266 return True
0 commit comments