

def move(self, target, pos=None):
    super(CMSPlugin, target).move(target, pos)
    self = self.reload()
    try:
        new_pos = (max(CMSPlugin.objects.filter(parent_id=self.parent_id, placeholder_id=self.placeholder_id, language=self.language).exclude(pk=self.pk).order_by('depth', 'path').values_list('position', flat=True)) + 1)
    except ValueError:
        new_pos = 0
    return self.update(refresh=True, position=new_pos)

dataset/ETHPy150Open divio/django-cms/cms/models/pluginmodel.py CMSPlugin.move/VarMisuse@20/22 `self`->`target`