#NEWLINE# def _extract_model_params( self , defaults , **kwargs ) : #NEWLINE# #INDENT# '\n        Prepares `lookup` (kwargs that are valid model attributes), `params`\n        (for creating a model instance) based on given kwargs; for use by\n        get_or_create and update_or_create.\n        ' #NEWLINE# defaults = ( defaults or { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# lookup = kwargs . copy ( ) #NEWLINE# for f in self . model . _meta . fields : #NEWLINE# #INDENT# if ( f . attname in lookup ) : #NEWLINE# #INDENT# lookup [ f . name ] = lookup . pop ( f . attname ) #NEWLINE# #UNINDENT# #UNINDENT# params = { k : v for ( k , v ) in kwargs . items ( ) if ( LOOKUP_SEP not in k ) } #NEWLINE# params . update ( f ) #NEWLINE# return ( lookup , params )