(self, obj, k)
Used by a Resource constructor to set the value of ONE given field taking any field
        validation and coercion into account.
Used by a Resource constructor to set the value of ONE given field taking any field
        validation and coercion into account.
Used by a Resource constructor to set the value of ONE given field taking any field validation and coercion into account .
def load(self, obj, k):
        """
        Used by a Resource constructor to set the value of ONE given field taking any field
        validation and coercion into account.
        """

        # compute the actual value, subbing in a default if required, coercing the value if required, etc
        v = self._get_coerced_resource_value(obj, k)

        # if none is disallowed, make sure the value isn't None
        if (not self.allow_none) and (v is None):
            raise Exception("%s, field %s: value may not be None" % (obj, k, v))

        # if self.find is set, we must type check the field
        if self.kind:
            self._run_type_checks(obj, k, v)
            
        # if a validator function is attached, run it.  It should raise an exception if there are validation problems
        if self.validator:
            self.validator(v)

        # all checks cleared (whew) - save the field to the object
        try:
            setattr(obj,k,v)
        except:
            print("failed to set: %s=%s on %s" % (k, v, type(obj)))
            raise
def load ( self , obj , k ) : # compute the actual value, subbing in a default if required, coercing the value if required, etc v = self . _get_coerced_resource_value ( obj , k ) # if none is disallowed, make sure the value isn't None if ( not self . allow_none ) and ( v is None ) : raise Exception ( "%s, field %s: value may not be None" % ( obj , k , v ) ) # if self.find is set, we must type check the field if self . kind : self . _run_type_checks ( obj , k , v ) # if a validator function is attached, run it.  It should raise an exception if there are validation problems if self . validator : self . validator ( v ) # all checks cleared (whew) - save the field to the object try : setattr ( obj , k , v ) except : print ( "failed to set: %s=%s on %s" % ( k , v , type ( obj ) ) ) raise