0.5.3 documentation
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user