Create the value for a field.

        :param data: the whole data for the entity (all fields).
        :param name: name of the initialized field.
        :param spec: spec for the whole entity.

def _create_value(self, data, name, spec):
        """ Create the value for a field.

        :param data: the whole data for the entity (all fields).
        :param name: name of the initialized field.
        :param spec: spec for the whole entity.
        """

        field = getattr(self, 'create_' + name, None)
        if field:
            # this factory has a special creator function for this field
            return field(data, name, spec)
        value = data.get(name)
        return spec.fields[name].clean(value)