def check_fields(context, fields):
 for field in fields:
  if (field.get('type') and (not _is_valid_pg_type(context, field['type']))):
   raise ValidationError({'fields': [u'"{0}" is not a valid field type'.format(field['type'])]})
  elif (not _is_valid_field_name(field['id'])):
   raise ValidationError({'fields': [u'"{0}" is not a valid field name'.format(field['id'])]})

def check_fields ( context , fields ) : for field in fields : if ( field . get ( 'type' ) and ( not _is_valid_pg_type ( context , field [ 'type' ] ) ) ) : raise ValidationError ( { 'fields' : [ u'"{0}" is not a valid field type' . format ( field [ 'type' ] ) ] } ) elif ( not _is_valid_field_name ( field [ 'id' ] ) ) : raise ValidationError ( { 'fields' : [ u'"{0}" is not a valid field name' . format ( field [ 'id' ] ) ] } )
check if field types are valid .