Skip to content

Commit f26d218

Browse files
committed
Convert unicode in model references
1 parent f9ba763 commit f26d218

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

json_to_models/models/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ def __init__(self, model: ModelMeta, post_init_converters=False, convert_unicode
7575
self.model = model
7676
self.post_init_converters = post_init_converters
7777
self.convert_unicode = convert_unicode
78+
self.model.name = self.convert_class_name(self.model.name)
7879

7980
@cached_method
8081
def convert_class_name(self, name):
81-
# TODO: Convert names in typing links (lei_da_tu: '雷达图')
8282
return prepare_label(name, convert_unicode=self.convert_unicode)
8383

8484
@cached_method
@@ -94,7 +94,7 @@ def generate(self, nested_classes: List[str] = None, extra: str = "") -> Tuple[I
9494
decorator_imports, decorators = self.decorators
9595
data = {
9696
"decorators": decorators,
97-
"name": self.convert_class_name(self.model.name),
97+
"name": self.model.name,
9898
"fields": fields,
9999
"extra": extra
100100
}

0 commit comments

Comments
 (0)