def move(self, direction='down'):
        swap = None
        
        if direction == 'up':
            swap = self.get_previous_forum()
            increment = False
        
        if direction == 'down':
            swap = self.get_next_forum()
            increment = True
        
        if not swap:
            return False
        
        self_range = self.get_position_range()
        swap_range = swap.get_position_range()
        
        base = Forum.objects.only('position').order_by('-position')[0].position * 2
        
        if direction == 'up':
            addition = len(self_range) - base
        else:
            addition = base + len(self_range)
        
        # Move to safe position.
        Forum.objects.update_position(swap_range, base)
        
        # Move ourself to where we should go.
        Forum.objects.update_position(self_range, len(swap_range), increment)
        
        # Move the swap to where it should go.
        Forum.objects.update_position(base, addition, False)
        
        return True
dataset/ETHPy150Open kylef-archive/lithium/lithium/forum/models.py/Forum.move/swapped operands of `-`