Skip to content

Commit ec8b264

Browse files
committed
using newer string interpolation
1 parent 43513ca commit ec8b264

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

templates/python/package/query.py.twig

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,34 +33,34 @@ class Query:
3333

3434
@staticmethod
3535
def orderDesc(attribute):
36-
return 'orderDesc("{}")'.format(attribute)
36+
return f'orderDesc("{attribute}")'
3737

3838
@staticmethod
3939
def cursorBefore(id):
40-
return 'cursorBefore("{}")'.format(id)
40+
return f'cursorBefore("{id}")'
4141

4242
@staticmethod
4343
def cursorAfter(id):
44-
return 'cursorAfter("{}")'.format(id)
44+
return f'cursorAfter("{id}")'
4545

4646
@staticmethod
4747
def limit(limit):
48-
return 'limit({})'.format(limit)
48+
return f'limit({limit})'
4949

5050
@staticmethod
5151
def offset(offset):
52-
return 'offset({})'.format(offset)
52+
return f'offset({offset})'
5353

5454
@staticmethod
5555
def addQuery(attribute, method, value):
5656
if type(value) == list:
57-
return '{}("{}", [{}])'.format(method, attribute, ','.join(map(Query.parseValues, value)))
57+
return f'{method}("{attribute}", [{",".join(map(Query.parseValues, value))}])'
5858
else:
59-
return '{}("{}", [{}])'.format(method, attribute, Query.parseValues(value))
59+
return f'{method}("{attribute}", [{Query.parseValues(value)}])'
6060

6161
@staticmethod
6262
def parseValues(value):
6363
if type(value) == str:
64-
return '"{}"'.format(value)
64+
return f'"{value}"'
6565
else:
6666
return str(value)

0 commit comments

Comments
 (0)