def set_slug(self, new_slug):
        """
        Changes this page's slug, and all other pages whose slugs
        start with this page's slug.
        """
        slug_prefix = "%s/" % self.slug
        for page in Page.objects.filter(slug__startswith=slug_prefix):
            if not page.overridden():
                page.slug = new_slug + page.slug[len(self.slug):]
                page.save()
        self.slug = new_slug
        self.save()
dataset/ETHPy150Open stephenmcd/mezzanine/mezzanine/pages/models.py/Page.set_slug/original