Started work on LocalizedMagicSlugField

This will be a superior version of LocalizedAutoSlugField, but one
that doesn't have concurrency issues and takes advantage of the
new UNIQUE CONSTRAINTs.
This commit is contained in:
Swen Kooij
2017-02-01 16:59:13 +02:00
parent 105c1e7b6b
commit e14350fbf3
8 changed files with 250 additions and 120 deletions

View File

@@ -9,9 +9,8 @@ from ..localized_value import LocalizedValue
class LocalizedAutoSlugField(LocalizedField):
"""Custom version of :see:AutoSlugField that
can operate on :see:LocalizedField and provides
unique slugs for every language."""
"""Automatically provides slugs for a localized
field upon saving."""
def __init__(self, *args, **kwargs):
"""Initializes a new instance of :see:LocalizedAutoSlugField."""
@@ -29,8 +28,8 @@ class LocalizedAutoSlugField(LocalizedField):
name, path, args, kwargs = super(
LocalizedAutoSlugField, self).deconstruct()
kwargs['populate_from'] = self.populate_from
kwargs['populate_from'] = self.populate_from
return name, path, args, kwargs
def formfield(self, **kwargs):