Validators
float_validator(value, context)
¶
Checks if the value can be parsed as a float and returns it if it can, otherwise raises Invalid. Rejects NaN and inf.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
the value |
required | |
context
|
the context |
required |
Returns:
| Type | Description |
|---|---|
float
|
a float |
Source code in ckanext/versioned_datastore/logic/validators.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
url_safe(value, context)
¶
Checks if the value is safe to be included in a URL as a slug.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
the value to check |
required | |
context
|
the context in which to check |
required |
Source code in ckanext/versioned_datastore/logic/validators.py
58 59 60 61 62 63 64 65 66 67 68 69 70 | |