Add optional readonly setting for slug and date #8

toddstowell opened this Issue Apr 25, 2012 · 1 comment


None yet

2 participants


I have several users who find it necessary to modify the slug on a blog entry after the story is active and trending via google news. I would love to see an optional setting that we can set to make the slug and also the date / time stamp fields read only so they cannot be messed with after the item has been published. Perhaps we can allow admins to still modify the fields if needed, but writers should in now way be allowed to change these fields once something has been pushed.

jsoa commented May 3, 2012

I believe this is a little out of scope for this app. Its more a management issue then a viewpoint issue. I would suggest simply creating your own viewpoint admin that provides the functionality. Here is a small example...

class MyCustomVewipointAdmin(admin.ModelAdmin):
    def get_readonly_fields(self, request, obj=None):
        if not obj:
            return self.readonly_fields
        elif not request.user.is_superuser:
            return self.readonly_fields + ('slug', 'date', 'other', 'etc')
        return self.readonly_fields

This snippet was written right here and not tested in anyway, but your real implementation should look similar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment