stephenmcd/mezzanine — pull request #833 by AlexHill (2013-11-27 02:34:17+00:00)
Title: Make auto-generated slugs propagate. Fixes #831.

This change factors out ``Slugged``'s unique slug generation out of ``save()`` into its own new method, ``generate_unique_slug()`` so that it can be called separately. This method is then called in ``PageAdmin.save_model()`` before ``Page.set_slug()``, so that the automatically-generated slug is propagated down the page tree.

Ideally I would like the new slug to be generated in ``PageAdminForm.clean_slug()`` - seems like the better logical place to put it - that's tricky, because we only have access to the existing instance with its old field values, but all the slug-handling methods operate on fields on ``self`` rather than method arguments.