Bases: object
This is called to coerce (if possible) a value on assignment.
This method should convert the value given into the designated type, or throw an exception if this is not possible.
:param:obj: The CinderObject on which an attribute is being set :param:attr: The name of the attribute being set :param:value: The value being set :returns: A properly-typed value
Returns a string describing the type of the field.
This is called to deserialize a value.
This method should deserialize a value from the form given by to_primitive() to the designated type.
:param:obj: The CinderObject on which the value is to be set :param:attr: The name of the attribute which will hold the value :param:value: The serialized form of the value :returns: The natural form of the value
Returns a short stringified version of a value.
This is called to serialize a value.
This method should serialize a value to the form expected by from_primitive().
:param:obj: The CinderObject on which the value is set :param:attr: The name of the attribute holding the value :param:value: The natural form of the value :returns: The serialized form of the value
Bases: cinder.objects.fields.Field
Bases: cinder.objects.fields.FieldType
Bases: cinder.objects.fields.AutoTypedField
Bases: cinder.objects.fields.FieldType
Bases: cinder.objects.fields.AutoTypedField
Bases: cinder.objects.fields.CompoundFieldType
Bases: cinder.objects.fields.AutoTypedField
Bases: cinder.objects.fields.AutoTypedField
Bases: cinder.objects.fields.AutoTypedField
Bases: object
Descriptor allowing us to assign pinning data as a dict of key_types.
This allows us to have an object field that will be a dict of key_type keys, allowing that will convert back to string-keyed dict.
This will take care of the conversion while the dict field will make sure that we store the raw json-serializable data on the object.
key_type should return a type that unambiguously responds to six.text_type so that calling key_type on it yields the same thing.
Bases: exceptions.TypeError
Bases: object
Coerce a value to a suitable type.
This is called any time you set a value on an object, like:
foo.myint = 1
and is responsible for making sure that the value (1 here) is of the proper type, or can be sanely converted.
This also handles the potentially nullable or defaultable nature of the field and calls the coerce() method on a FieldType to actually do the coercion.
:param:obj: The object being acted upon :param:attr: The name of the attribute/field being set :param:value: The value being set :returns: The properly-typed value
Return a short string describing the type of this field.
Deserialize a value from primitive form.
This is responsible for deserializing a value from primitive into regular form. It calls the from_primitive() method on a FieldType to do the actual deserialization.
:param:obj: The object being acted upon :param:attr: The name of the attribute/field being deserialized :param:value: The value to be deserialized :returns: The deserialized value
Serialize a value to primitive form.
This is responsible for serializing a value to primitive form. It calls to_primitive() on a FieldType to do the actual serialization.
:param:obj: The object being acted upon :param:attr: The name of the attribute/field being serialized :param:value: The value to be serialized :returns: The serialized value
Bases: cinder.objects.fields.AbstractFieldType
Bases: cinder.objects.fields.FieldType
Bases: cinder.objects.fields.AutoTypedField
Bases: cinder.objects.fields.FieldType
Bases: cinder.objects.fields.IPAddress
Bases: cinder.objects.fields.IPAddress
Bases: cinder.objects.fields.IPAddress
Bases: cinder.objects.fields.IPNetwork
Bases: cinder.objects.fields.IPAddress
Bases: cinder.objects.fields.IPNetwork
Bases: cinder.objects.fields.FieldType
Bases: cinder.objects.fields.AutoTypedField
Bases: exceptions.TypeError
Bases: cinder.objects.fields.CompoundFieldType
Bases: cinder.objects.fields.AutoTypedField
Bases: cinder.objects.fields.AutoTypedField
Bases: cinder.objects.fields.AutoTypedField
Bases: cinder.objects.fields.FieldType
Bases: cinder.objects.fields.CompoundFieldType
Bases: cinder.objects.fields.AutoTypedField
Bases: cinder.objects.fields.FieldType
Bases: cinder.objects.fields.AutoTypedField
Bases: cinder.objects.fields.FieldType
Bases: cinder.objects.fields.AutoTypedField
Bases: object