mirror of
https://github.com/SectorLabs/django-localized-fields.git
synced 2025-10-29 18:18:57 +03:00
Add support for using a callable to populate slug with
This commit is contained in:
@@ -166,6 +166,9 @@ class LocalizedAutoSlugField(LocalizedField):
|
||||
The text to generate a slug for.
|
||||
"""
|
||||
|
||||
if callable(field_name):
|
||||
return field_name(instance)
|
||||
|
||||
def get_field_value(name):
|
||||
value = resolve_object_property(instance, name)
|
||||
with translation.override(language):
|
||||
|
||||
Reference in New Issue
Block a user