Add option include_time to LocalizedUniqueSlugField

This commit is contained in:
Swen Kooij
2017-02-15 19:13:19 +02:00
parent 64c3c06612
commit ca6b1c88fa
4 changed files with 63 additions and 10 deletions

View File

@@ -212,6 +212,15 @@ Besides ``LocalizedField``, there's also:
title = LocalizedField()
slug = LocalizedUniqueSlugField(populate_from='title')
By setting the option ``include_time=True``
.. code-block:: python
slug = LocalizedUniqueSlugField(populate_from='title', include_time=True)
You can instruct the field to include a part of the current time into
the resulting slug. This is useful if you're running into a lot of collisions.
* ``LocalizedAutoSlugField``
Automatically creates a slug for every language from the specified field.