huskar_api/api/schema/__init__.py
def validate_fields(schema, data, optional_fields=(), partial=True):
    """validate fields value but which field name in `optional_fields`
    and the value is None.
    """
    if not switch.is_switched_on(SWITCH_VALIDATE_SCHEMA, True):
        return

    fields = set(data)
    if not fields.issubset(schema.fields):
        raise ValidationError(
            'The set of fields "%s" is not a subset of %s'
            % (fields, schema))

    data = {k: v for k, v in data.items()
            if not (k in optional_fields and v is None)}
    schema.validate(data, partial=partial)
validate fields value but which field name in `optional_fields`
    and the value is None.
    
validate fields value but which field name in `optional_fields`
and the value is None.
validate fields value but which field name in ` optional_fields ` and the value is None .
def validate_fields(schema, data, optional_fields=(), partial=True):
    if not switch.is_switched_on(SWITCH_VALIDATE_SCHEMA, True):
        return
    fields = set(data)
    if not fields.issubset(schema.fields):
        raise ValidationError(
            'The set of fields "%s" is not a subset of %s'
            % (fields, schema))
    data = {k: v for k, v in data.items()
            if not (k in optional_fields and v is None)}
    schema.validate(data, partial=partial)
def validate_fields ( schema , data , optional_fields = ( ) , partial = True ) : if not switch . is_switched_on ( SWITCH_VALIDATE_SCHEMA , True ) : return fields = set ( data ) if not fields . issubset ( schema . fields ) : raise ValidationError ( 'The set of fields "%s" is not a subset of %s' % ( fields , schema ) ) data = { k : v for k , v in data . items ( ) if not ( k in optional_fields and v is None ) } schema . validate ( data , partial = partial )
validate fields value but which field name in `optional_fields`
and the value is None.
validate fields value but which field name in ` optional_fields ` and the value is None .
"""validate fields value but which field name in `optional_fields`
    and the value is None.
    """
schema
data
optional_fields
partial