justinmayer / django-autoslug

AutoSlugField for Django. Supports (but not does not require) unidecode/pytils for transliteration. Old issue tracker is at Bitbucket: https://bitbucket.org/neithere/django-autoslug/issues

Home Page:https://readthedocs.org/projects/django-autoslug/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Function to generate unique slug can generate an excessive number of DB query

jpaulodit opened this issue · comments

The code that generates the unique slug is querying the database indefinitely until it finds the unique value.

In the case of common words, this causes excessive number of db calls. It would be nice if it was possible to specify the maximum number of tries. A uuid value can be used to generate the slug after index exceeds that number.

Added suggested fix in PR #15

Fix for this issue was proposed in above-referenced PR, but it was subsequently closed without explanation. Closing this issue until such time as someone wants to look at it again.