Validators
colour_validator(value, context)
¶
Validate a value is a CSS hex color.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
the value to validate |
required | |
context
|
the context within which this validation is taking place |
required |
Returns:
| Type | Description |
|---|---|
|
the validated value |
Source code in ckanext/tiledmap/lib/validators.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | |
float_01_validator(value, context)
¶
Validates that the value is a float number between 0 and 1.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
the value |
required | |
context
|
the context within which this validation is taking place |
required |
Returns:
| Type | Description |
|---|---|
|
the validated value |
Source code in ckanext/tiledmap/lib/validators.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | |
is_datastore_field(value, context)
¶
Check that the fields are indeed a datastore fields.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
the value to validate |
required | |
context
|
the context within which this validation is taking place |
required |
Returns:
| Type | Description |
|---|---|
|
the value |
Source code in ckanext/tiledmap/lib/validators.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |
is_view_id(value, context)
¶
Ensure this is a view id on the current resource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
the value to validate |
required | |
context
|
the context within which this validation is taking place |
required |
Returns:
| Type | Description |
|---|---|
|
the value |
Source code in ckanext/tiledmap/lib/validators.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |