question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AutoSlugField unique argument

See original GitHub issue

I 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:closed
  • Created 13 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
wyleungcommented, Jun 8, 2010

Having non-unique Slugfield is fundamentaly wrong, because you lookup your content by the slug-name (most apps, instead of pk)

0reactions
j0hnsmithcommented, Feb 25, 2011

Nice

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found