Skip to content

Commit 684d950

Browse files
committed
fix string_util
1 parent f28b4b4 commit 684d950

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tigeropen/common/util/string_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ def camel_to_underline_obj(d):
2828
for k, v in d.items()}
2929

3030

31-
def camel_to_underline(camel_str):
32-
parts = camel_str.split('_')
31+
def underline_to_camel(underline_str):
32+
parts = underline_str.split('_')
3333
return parts[0] + ''.join(x.title() for x in parts[1:])

tigeropen/quote/domain/filter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# @Author : sukai
55
from tigeropen.common.consts import SortDirection
66
from tigeropen.common.model import Field
7-
from tigeropen.common.util.string_utils import camel_to_underline
7+
from tigeropen.common.util.string_utils import underline_to_camel
88

99
GREEKS = ['delta', 'gamma', 'theta', 'vega', 'rho']
1010

@@ -79,7 +79,7 @@ def __init__(self, field, min_value=None, max_value=None, sort_direction=None, e
7979

8080
def to_dict(self):
8181

82-
return {'field': camel_to_underline(self.field.name if isinstance(self.field, Field) else self.field),
82+
return {'field': underline_to_camel(self.field.name if isinstance(self.field, Field) else self.field),
8383
'min_value': self.min_value,
8484
'max_value': self.max_value,
8585
'sort_direction': self.sort.value if isinstance(self.sort, SortDirection) else self.sort,

0 commit comments

Comments
 (0)