-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace slugify with unicode-aware filter
- Loading branch information
Sebastian Vetter
committed
Dec 20, 2013
1 parent
325a5aa
commit d3e6356
Showing
7 changed files
with
34 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from django import template | ||
|
||
from ..utils import unicode_slugify | ||
|
||
register = template.Library() | ||
|
||
|
||
@register.filter | ||
def fp_slugify(value): | ||
""" | ||
Extends the default ``slugify`` filter provided in Django to work with | ||
non-Ascii characters. The slugify function used uses ``unidecode`` before | ||
applying the default slugifier. If Oscar is installed, however, the more | ||
sophisticated slugifier in ``oscar.core.utils`` is used and the | ||
``OSCAR_SLUG_MAP`` and ``OSCAR_SLUG_BLACKLIST`` are both respected. | ||
""" | ||
return unicode_slugify(value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters