Validators
in_list(list_possible_values)
¶
Validator that checks that the input value is one of the given possible values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
list_possible_values
|
function that returns list of possible values for validated field |
required |
Source code in ckanext/graph/logic/validators.py
37 38 39 40 41 42 43 44 45 46 47 48 49 | |
is_boolean(value, context)
¶
Validate a field as a boolean. Assuming missing value means false.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
|
required | |
context
|
|
required |
Source code in ckanext/graph/logic/validators.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | |
is_date_castable(value, context)
¶
Validator to ensure the date is castable to a date field.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
|
required | |
context
|
|
required |
Source code in ckanext/graph/logic/validators.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | |