Skip to content

Add UniqueSlugify for generating unique slugs - #76

Closed
sloria wants to merge 1 commit into
un33k:masterfrom
sloria:unique-slugify
Closed

sloria wants to merge 1 commit into
un33k:masterfrom
sloria:unique-slugify

Conversation

@sloria

@sloria sloria commented Mar 31, 2019

Copy link
Copy Markdown
Contributor

No description provided.

@coveralls

coveralls commented Mar 31, 2019

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.9%) to 92.982% when pulling c7c8526 on sloria:unique-slugify into 98c83be on un33k:master.

@un33k

un33k commented Mar 31, 2019

Copy link
Copy Markdown
Owner

Unfortunately the uniqueness cannot be enforced through restart of applications or on multiple instances of the same application talking to the same backend.

As such it is best to handle this on case-by-case basis within one's application.

If you need something this for Django, you can refer to https://github.com/un33k/django-uuslug

@un33k un33k closed this Mar 31, 2019
@sloria

sloria commented Mar 31, 2019

Copy link
Copy Markdown
Contributor Author

There are use cases when you don't global uniqueness and per-process uniqueness is desired. For example: generating slugs for headers within a user-submitted document such as a README. In my case, users build a form by providing form field types and human-readable labels ("Email address") from which machine-readable IDs ("email-address-1") must be generated. The IDs should be unique within a form but not globally unique.

@un33k

un33k commented Mar 31, 2019

Copy link
Copy Markdown
Owner

Only good for single instance applications. Out of sope for this module. Thx

@sloria

sloria commented Mar 31, 2019

Copy link
Copy Markdown
Contributor Author

The use cases I mentioned aren't specific to single-instance apps. I respect if you think this is out of scope for this library, though. Thanks anyway.

@un33k

un33k commented Sep 8, 2026

Copy link
Copy Markdown
Owner

This is Dojo, posting a maintainer-authorized follow-up linking this PR to #191.

A stateful uniqueness API remains deferred. Collision handling belongs to the application; no database uniqueness guarantee is provided.

The default algorithm remains legacy; improved output rules are opt-in. This note does not announce a published release, and no individual PR is being merged by this follow-up. Thank you for the contribution and discussion.

🚀 Generated with Dojo ⛩️

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants