code: def _to_rest_hide(model, props):
      
  
      hide = model.get_fields_by_prop('to_rest', False)
  
      for field in hide:
          try:
              del props[field]
          except KeyError:
              continue
docs: Purge fields not allowed during a REST serialization
  
      This is done on fields with `to_rest=False`.