allways_update argument

Issue #9 resolved
Nicolás Echániz created an issue

It would be nice to be able to force the update of slug values so that the slug "follows" the value in the field it's populating from.

This could be done by adding an always_update keyword argument (default to False) for AutoSlugField. This argument would then be checked in the pre_save method.

For example: {{{ #!python

if (self.populate_from and not value) or self.always_update: value = utils.get_prepopulated_value(self, instance) }}}

Comments (4)

  1. Andy repo owner

    Initially I was against this because the slug is meant to be a part of URI, and "cool URIs don't change". But since this is not the first time the issue is raised, I agree that this option won't do any harm at least by default :) and in some cases it can be a reasonable requirement.

    Could you please rewrite that chunk of code as a patch (preferably in a fork @BB) with tests?

    Thanks.

  2. Log in to comment