Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need settings option FORCE_LOWERCASE_TAGS #70

Closed
shacker opened this issue Apr 17, 2011 · 5 comments
Closed

Need settings option FORCE_LOWERCASE_TAGS #70

shacker opened this issue Apr 17, 2011 · 5 comments

Comments

@shacker
Copy link

shacker commented Apr 17, 2011

Slugs are lowercased by being passed through slugify, but tag names are not. Thus some users can enter "Music" and others enter "music" - these are functionally identical, but taggit creates two tags "music" and "music_1", and tag listings and clouds of course show both versions, which is confusing.

Django-tagging has a global settings option to force all lowercase tags and I'd love to see the same in Taggit.

@shacker
Copy link
Author

shacker commented May 18, 2011

In case anyone else needs this, I've created a fork https://github.com/shacker/django-taggit with two new options:

TAGGIT_FORCE_LOWERCASE
TAGGIT_STOPWORDS

The latter is defined as a list in settings - any bare words in that list (of, the, for, to, etc.) will be removed from the tag set. I'm no Alex Gaynor, but it seems to work :)

@gnotaras
Copy link

gnotaras commented Jun 2, 2011

+1 for these features.

@MechanisM
Copy link
Member

would like to have these options too.

@nookiepl
Copy link

nookiepl commented Sep 2, 2011

+100. :P

Or make FooBar == foobar, and not foobar == foobar, and FooBar == foobar_1. :(

qris added a commit to aptivate/django-taggit that referenced this issue Sep 15, 2014
I don't think it makes sense to have tags which differ only in case. It's not even possible on MySQL because it violates the
unique constraint on tag name:

    IntegrityError: (1062, "Duplicate entry 'LONDON' for key 'taggit_tag_name_6b48d50f_uniq'")

This PR adds a new setting, `TAGGIT_CASE_INSENSITIVE`, which causes existing tags to be looked up case insensitively. New
tags are added with the supplied case, which will be used from then on. The default behaviour is the same as before without
this setting.

This meets nookiepl's request on jazzband#70, and my comment on jazzband#9.
@frewsxcv
Copy link
Collaborator

frewsxcv commented Jul 4, 2015

Case insensitive tags was added in #325 and is available in the latest version of taggit (0.16.0)

@frewsxcv frewsxcv closed this as completed Jul 4, 2015
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

No branches or pull requests

5 participants