Add case-insensitive option for tag names. #325

Merged
merged 1 commit into from Jul 4, 2015

Projects

None yet

2 participants

@mfeliu
Contributor
mfeliu commented Jul 1, 2015

This commit was adapted from an unmerged pull request #263 done by qris. The following text is his original commit message:

Add case-insensitive option for tag names.

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 #70, and my comment on #9.

@frewsxcv
Collaborator
frewsxcv commented Jul 3, 2015

@mfeliu Seems alright to me. Can you do me one favor before merging? Can you just mention this setting exist somewhere in the documentation?

@mfeliu @mfeliu mfeliu Add case-insensitive option for tag names.
This commit was adapted from an unmerged pull request [#263](alex#263) done by [qris](https://github.com/qrisa). The following text is his original commit message:

Add case-insensitive option for tag names.

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 #70, and my comment on #9.
0c8013f
@mfeliu
Contributor
mfeliu commented Jul 4, 2015

@frewsxcv, I have included a note in the Getting Started section of the documentation.

@frewsxcv
Collaborator
frewsxcv commented Jul 4, 2015

Great job @mfeliu, thanks!

@frewsxcv frewsxcv merged commit 6a875d4 into alex:develop Jul 4, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@frewsxcv
Collaborator
frewsxcv commented Jul 4, 2015

Released 0.16.0 that includes this change. Thanks again :)

https://pypi.python.org/pypi/django-taggit/0.16.0

@mfeliu
Contributor
mfeliu commented Jul 4, 2015

Thank you!

@mfeliu mfeliu deleted the mfeliu:case_insensitive_option_for_tag_names branch Jul 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment