Features: 1) Update regex pattern for slug field generation to exclude non-alphanumeric characters; 2) Add support for custom separators in slugs;
Fixes: 1) Remove unnecessary debug logging from get_slug_fields function; Extra: 1) Minor cleanup in db utility functions;
This commit is contained in:
parent
f2596c25a2
commit
e6ffb476fb
1 changed files with 2 additions and 5 deletions
|
|
@ -26,7 +26,8 @@ def unicode_slugify_function(content):
|
||||||
max_length=88,
|
max_length=88,
|
||||||
word_boundary=True,
|
word_boundary=True,
|
||||||
save_order=True,
|
save_order=True,
|
||||||
regex_pattern=r"/",
|
regex_pattern=r"[^A-Za-z0-9-]+",
|
||||||
|
separator="-",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -38,10 +39,6 @@ class TweakedAutoSlugField(AutoSlugField):
|
||||||
lookup_value_path = lookup_value.split(LOOKUP_SEP)
|
lookup_value_path = lookup_value.split(LOOKUP_SEP)
|
||||||
attr = model_instance
|
attr = model_instance
|
||||||
|
|
||||||
logger.debug(
|
|
||||||
f"get_slug_fields: lookup_value_path is {lookup_value_path} and attr is {attr}"
|
|
||||||
)
|
|
||||||
|
|
||||||
for elem in lookup_value_path:
|
for elem in lookup_value_path:
|
||||||
try:
|
try:
|
||||||
attr = getattr(attr, elem)
|
attr = getattr(attr, elem)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue