Added documentation on LocalizedMagicSlugField

This commit is contained in:
Swen Kooij 2017-02-02 11:00:31 +02:00
parent a48eb12370
commit d067660e7f

View File

@ -196,6 +196,20 @@ Other fields
^^^^^^^^^^^^ ^^^^^^^^^^^^
Besides ``LocalizedField``, there's also: 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`` * ``LocalizedAutoSlugField``
Automatically creates a slug for every language from the specified field. Automatically creates a slug for every language from the specified field.
@ -211,6 +225,8 @@ Besides ``LocalizedField``, there's also:
title = LocalizedField() title = LocalizedField()
slug = LocalizedAutoSlugField(populate_from='title') slug = LocalizedAutoSlugField(populate_from='title')
**This implementation is NOT concurrency safe, prefer ``LocalizedMagicSlugField``**
* ``LocalizedBleachField`` * ``LocalizedBleachField``
Automatically bleaches the content of the field. Automatically bleaches the content of the field.
* django-bleach * django-bleach