AutoSlugField unique argument
See original GitHub issueI like AutoSlugField’s populate from argument however sometimes I don’t need to slug to be unique (eg number incremented and added). It would be good if I could pass AutoSlugField(populate_from='name',overwrite=True,unique=False)
to prevent the unique functionality
Issue Analytics
- State:
- Created 13 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Fields — Django Autoslug 1.9 documentation - Read the Docs
Uniqueness is preserved by checking if the slug is unique with given constraints ( unique_with ) or globally ( unique ) and adding...
Read more >Fields — Django Autoslug 1.6 documentation
AutoSlugField is an extended SlugField able to automatically resolve name clashes. AutoSlugField can also perform the following tasks on save: populate itself ...
Read more >ValueError while using AutoSlugField and Django-tagging
There's already a UNIQUE index on it. Just use the id column as your primary key (the default behaviour) and you're done. I...
Read more >Django Autoslug Documentation - Read the Docs
from autoslug import AutoSlugField ... If callable is given, it should accept instance parameter ... slug = AutoSlugField(unique=True).
Read more >2.0.8: AutoSlugField: Given slug in object creation gets ignored
I'd suggest adding another argument to AutoSlugField to explicitly turn on the option to only generate the slug when it's blank.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Having non-unique Slugfield is fundamentaly wrong, because you lookup your content by the slug-name (most apps, instead of pk)
Nice