mirror of
https://github.com/SectorLabs/django-localized-fields.git
synced 2025-04-25 11:42:54 +03:00
Added documentation on LocalizedMagicSlugField
This commit is contained in:
parent
a48eb12370
commit
d067660e7f
16
README.rst
16
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user