

def save(self, no_signals=False, *args, **kwargs):
    if (not self.depth):
        if (self.parent_id or self.parent):
            self.parent.add_child(instance=self)
        else:
            if ((not self.position) and (not (self.position == 0))):
                self.position = CMSPlugin.objects.filter(parent__isnull=True, language=self.language, placeholder_id=self.placeholder_id).count()
            self.add_root(instance=self)
        return
    super(CMSPlugin, self).save(*args, **kwargs)

dataset/ETHPy150Open divio/django-cms/cms/models/pluginmodel.py CMSPlugin.save/original