def _clone ( self , * args , * * kwargs ) : for attr in ( "_search_terms" , "_search_fields" , "_search_ordered" ) : kwargs [ attr ] = getattr ( self , attr ) return super ( SearchableQuerySet , self ) . _clone ( * args , * * kwargs )
python clone query set
Ensure attributes are copied to subsequent queries .
def _clone(self, *args, **kwargs):
        """
        Ensure attributes are copied to subsequent queries.
        """
        for attr in ("_search_terms", "_search_fields", "_search_ordered"):
            kwargs[attr] = getattr(self, attr)
        return super(SearchableQuerySet, self)._clone(*args, **kwargs)