graphene-django/graphene_django/utils/str_converters.py
2023-08-05 19:57:33 +08:00

8 lines
134 B
Python

import re
from text_unidecode import unidecode
def to_const(string):
return re.sub(r"[\W|^]+", "_", unidecode(string)).upper()