mirror of
https://github.com/jazzband/django-categories.git
synced 2026-03-16 22:30:24 +00:00
Formally fixes #1 by adding the ability to specify a transliteration function.
This commit is contained in:
parent
96a3f61928
commit
97c14b19ea
1 changed files with 10 additions and 0 deletions
|
|
@ -18,6 +18,7 @@ The default settings are:
|
|||
'FK_REGISTRY': {},
|
||||
'THUMBNAIL_UPLOAD_PATH': 'uploads/categories/thumbnails',
|
||||
'THUMBNAIL_STORAGE': settings.DEFAULT_FILE_STORAGE,
|
||||
'SLUG_TRANSLITERATOR': lambda x: x,
|
||||
}
|
||||
|
||||
ALLOW_SLUG_CHANGE
|
||||
|
|
@ -27,6 +28,15 @@ ALLOW_SLUG_CHANGE
|
|||
|
||||
**Description:** Changing the slug for a category can have serious consequences if it is used as part of a URL. Setting this to ``True`` will allow users to change the slug of a category.
|
||||
|
||||
SLUG_TRANSLITERATOR
|
||||
===================
|
||||
|
||||
**Default:** ``lambda x: x``
|
||||
|
||||
**Description:** Allows the specification of a function to convert non-ASCII characters in the potential slug to ASCII characters. Allows specifying a ``callable()`` or a string in the form of ``'path.to.module.function'``.
|
||||
|
||||
A great tool for this is `Unidecode <http://pypi.python.org/pypi/Unidecode>`_. Use it by setting ``SLUG_TRANSLITERATOR`` to ``'unidecode.unidecode``.
|
||||
|
||||
CACHE_VIEW_LENGTH
|
||||
=================
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue