0.5.3 documentation

This commit is contained in:
SDE
2024-07-11 15:06:06 +03:00
parent 5272d7503f
commit 1aeb83d571
2 changed files with 37 additions and 3 deletions

View File

@@ -346,6 +346,23 @@ def translit(locallangstring):
return ''.join(translitstring)
def create_url(data, model):
url = None
objs = True
i = 0
while objs:
url = url_translit(data['name'])
if i > 0:
url += f'_{str(i)}'
objs = model.objects.filter(url=url)
i += 1
return url
def slugify_text(str_text):
utf8_code = False
try: