unique should be True by default on SlugField instead of False.
|Reported by:||anonymous||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Perhaps it's just me, but I've very rarely wanted a SlugField that wasn't unique. Would this not be a sensible default? I realise that a lot of apps will rely upon this default, but objectively speaking would this not be better? Perhaps this change would be appropriate for django 2.0.
At the moment,
slug = models.SlugField()
creates a non-unique field, and if you want it to be unique, then you must add unique=True.
It seems to me that unique should be default, and if you don't want a unique slug, you should explicitly state that:
slug = models.SlugField(unique=False)