We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d2e2729 commit 6ba5765Copy full SHA for 6ba5765
1 file changed
dateandtimeparser/_validators.py
@@ -0,0 +1,16 @@
1
+def _datetime_format_type_validator(instance, attribute, value):
2
+ if value != None and not isinstance(value, list):
3
+ raise ValueError(
4
+ "datetime_format attribute can be of type 'list' or 'None'.")
5
+
6
7
+def _mode_type_validator(instance, attribute, value):
8
+ if value not in ["date", "datetime", "time"]:
9
10
+ "mode attribute's format can be of type 'date', 'time' or 'datetime'.")
11
12
13
+def _end_year_validator(instance, attribute, value):
14
+ if value < instance.start_year:
15
16
+ "'end_year' has to be greater than or equal to 'start_year'!")
0 commit comments