def _filter_keys(item, keys):
 return {k: v for (k, v) in item.items() if (k in keys)}

def _filter_keys ( item , keys ) : return { k : v for ( k , v ) in item . items ( ) if ( k in keys ) }
filters all model attributes except for keys item is a dict .