From d067660e7f51b46974646f8035e30e76df1c38d1 Mon Sep 17 00:00:00 2001 From: Swen Kooij Date: Thu, 2 Feb 2017 11:00:31 +0200 Subject: [PATCH] Added documentation on LocalizedMagicSlugField --- README.rst | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.rst b/README.rst index ec56f0b..841dde8 100644 --- a/README.rst +++ b/README.rst @@ -196,6 +196,20 @@ Other fields ^^^^^^^^^^^^ Besides ``LocalizedField``, there's also: +* ``LocalizedMagicSlugField`` + Successor of ``LocalizedAutoSlugField`` that fixes concurrency issues and enforces + uniqueness of slugs on a database level. Usage is the exact same: + + .. code-block:: python + + from localized_fields.models import LocalizedModel + from localized_fields.fields import (LocalizedField, + LocalizedMagicSlugField) + + class MyModel(LocalizedModel): + title = LocalizedField() + slug = LocalizedMagicSlugField(populate_from='title') + * ``LocalizedAutoSlugField`` Automatically creates a slug for every language from the specified field. @@ -211,6 +225,8 @@ Besides ``LocalizedField``, there's also: title = LocalizedField() slug = LocalizedAutoSlugField(populate_from='title') + **This implementation is NOT concurrency safe, prefer ``LocalizedMagicSlugField``** + * ``LocalizedBleachField`` Automatically bleaches the content of the field. * django-bleach