#NEWLINE# def clone( self , klass = None , memo = None , **kwargs ) : #NEWLINE# #INDENT# "\n        Creates a copy of the current instance. The 'kwargs' parameter can be\n        used by clients to update attributes after copying has taken place.\n        " #NEWLINE# obj = Empty ( ) #NEWLINE# obj . __class__ = ( klass or self . __class__ ) #NEWLINE# obj . model = self . model #NEWLINE# obj . alias_refcount = self . alias_refcount . copy ( ) #NEWLINE# obj . alias_map = self . alias_map . copy ( ) #NEWLINE# obj . table_map = self . table_map . copy ( ) #NEWLINE# obj . join_map = self . join_map . copy ( ) #NEWLINE# obj . default_cols = self . default_cols #NEWLINE# obj . default_ordering = self . default_ordering #NEWLINE# obj . standard_ordering = self . standard_ordering #NEWLINE# obj . included_inherited_models = self . included_inherited_models . copy ( ) #NEWLINE# obj . select = self . select [ : ] #NEWLINE# obj . related_select_cols = [ ] #NEWLINE# obj . tables = self . tables [ : ] #NEWLINE# obj . where = self . where . clone ( ) #NEWLINE# obj . where_class = self . where_class #NEWLINE# if ( self . group_by is None ) : #NEWLINE# #INDENT# obj . group_by = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# obj . group_by = self . group_by [ : ] #NEWLINE# #UNINDENT# obj . having = self . having . clone ( ) #NEWLINE# obj . order_by = self . order_by [ : ] #NEWLINE# ( obj . low_mark , obj . high_mark ) = ( self . low_mark , self . high_mark ) #NEWLINE# obj . distinct = self . distinct #NEWLINE# obj . distinct_fields = self . distinct_fields [ : ] #NEWLINE# obj . select_for_update = self . select_for_update #NEWLINE# obj . select_for_update_nowait = self . select_for_update_nowait #NEWLINE# obj . select_related = self . select_related #NEWLINE# obj . related_select_cols = [ ] #NEWLINE# obj . aggregates = self . aggregates . copy ( ) #NEWLINE# if ( self . aggregate_select_mask is None ) : #NEWLINE# #INDENT# obj . aggregate_select_mask = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# obj . aggregate_select_mask = self . aggregate_select_mask . copy ( ) #NEWLINE# #UNINDENT# obj . _aggregate_select_cache = None #NEWLINE# obj . max_depth = self . max_depth #NEWLINE# obj . extra = self . extra . copy ( ) #NEWLINE# if ( klass . extra_select_mask is None ) : #NEWLINE# #INDENT# obj . extra_select_mask = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# obj . extra_select_mask = self . extra_select_mask . copy ( ) #NEWLINE# #UNINDENT# if ( self . _extra_select_cache is None ) : #NEWLINE# #INDENT# obj . _extra_select_cache = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# obj . _extra_select_cache = self . _extra_select_cache . copy ( ) #NEWLINE# #UNINDENT# obj . extra_tables = self . extra_tables #NEWLINE# obj . extra_order_by = self . extra_order_by #NEWLINE# obj . deferred_loading = ( copy . copy ( self . deferred_loading [ 0 ] ) , self . deferred_loading [ 1 ] ) #NEWLINE# if ( self . filter_is_sticky and self . used_aliases ) : #NEWLINE# #INDENT# obj . used_aliases = self . used_aliases . copy ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# obj . used_aliases = set ( ) #NEWLINE# #UNINDENT# obj . filter_is_sticky = False #NEWLINE# obj . __dict__ . update ( kwargs ) #NEWLINE# if hasattr ( obj , '_setup_query' ) : #NEWLINE# #INDENT# obj . _setup_query ( ) #NEWLINE# #UNINDENT# return obj