Workaround for django.template.defaultfilters.slugify bug

Issue #175 new
Denis Vasiliev
created an issue

There is an old bug in django with slugify filter and natioinal symbols. ( )

Could you use proposed function ( ) instead of default django slugify function?

Problem is here -

Comments (3)

  1. Kai Diefenbach repo owner

    I haven't read the whole ticket yet, but maybe you can give me some pointers in advance:

    • Why is that not fixed in Django core?
    • Why is proposed slugify2 not used in Django core?
    • Are there any side effects?

    Thanks Kai

  2. Denis Vasiliev reporter

    1) Why is that not fixed in Django core? 2) Why is proposed slugify2 not used in Django core?

    To say the Truth - I don't know. They agreed on the fact, that this feature should be implemented that way (exactly the same way it's done in JS). Than somebody proposed implementation and since then nobody did anything. May be it's just low priority feature and developers are just busy.

    3) Are there any side effects?

    It's a bit slower (since it uses regexp). On strings, that contain only normal latin symbols, it does exactly the same effect. On strings, that contain national symbols it performs way better, cause current slugify just drops this symbols from input string.

  3. Maciej Wiƛniowski

    I think that it is not fixed in Django core because there is no patch yet. There is only an implementation on someone's else fork and it doesn't have any tests.

    I've used another implementation of slugify (for the same reason):

    and it worked (and still works) without problems.

    In general I think that would be nice to have it in LFS but also feel free to prepare patch against django trunk :)

  4. Log in to comment