def drop_protected_attrs(model_class, values):
 for attr in model_class.__protected_attributes__:
  if (attr in values):
   del values[attr]

def drop_protected_attrs ( model_class , values ) : for attr in model_class . __protected_attributes__ : if ( attr in values ) : del values [ attr ]
removed protected attributes from values dictionary using the models __protected_attributes__ field .