A base class for Types in a Schematics model. Instances of this class may be added to subclasses of Model to define a model schema.
Validators that need to access variables on the instance can be defined be implementing methods whose names start with validate_ and accept one parameter (in addition to self)
Parameters: |
|
---|
Convert untrusted data to a richer Python construct.
Convert internal data to a value safe to serialize.
Validate the field and return a clean value or raise a ValidationError with a list of errors raised by the validation chain. Stop the validation process from continuing through the validators by raising StopValidation instead of ValidationError.
A boolean field type. In addition to True and False, coerces these values:
Defaults to converting to and from ISO8601 datetime values.
Parameters: |
|
---|
Defaults to converting to and from ISO8601 date values.
A fixed-point decimal number field.
A field that validates input as an E-Mail-Address.
A field that validates input as a Float
A list storing a latitude and longitude.
Make sure that a geo-value is of type (x, y)
A field that stores a valid IPv4 address
Make sure the value is a IPv4 address: http://stackoverflow.com/questions/9948833/validate-ip-address-from-list
A field that validates input as an Integer
A field that validates input as a Long
A field that validates input as resembling an MD5 hash.
A number field.
A field that validates input as resembling an SHA1 hash.
A unicode string field. Default minimum length is one. If you want to accept empty strings, init with min_length 0.
Meta class for BaseType. Merges MESSAGES dict and accumulates validator methods.
A field that validates input as an URL.
If verify_exists=True is passed the validate function will make sure the URL makes a valid connection.
A field that stores a valid UUID value.
To learn more about how Types are used, visit Using Types