11class Query:
22 @staticmethod
33 def equal(attribute, value):
4- return Query.addQuery (attribute, "equal", value)
4+ return Query.add_query (attribute, "equal", value)
55
66 @staticmethod
7- def notEqual (attribute, value):
8- return Query.addQuery (attribute, "notEqual", value)
7+ def not_equal (attribute, value):
8+ return Query.add_query (attribute, "notEqual", value)
99
1010 @staticmethod
11- def lessThan (attribute, value):
12- return Query.addQuery (attribute, "lessThan", value)
11+ def less_than (attribute, value):
12+ return Query.add_query (attribute, "lessThan", value)
1313
1414 @staticmethod
15- def lessThanEqual (attribute, value):
16- return Query.addQuery (attribute, "lessThanEqual", value)
15+ def less_than_equal (attribute, value):
16+ return Query.add_query (attribute, "lessThanEqual", value)
1717
1818 @staticmethod
19- def greaterThan (attribute, value):
20- return Query.addQuery (attribute, "greaterThan", value)
19+ def greater_than (attribute, value):
20+ return Query.add_query (attribute, "greaterThan", value)
2121
2222 @staticmethod
23- def greaterThanEqual(attribute, value):
24- return Query.addQuery(attribute, "greaterThanEqual", value)
23+ def greater_than_equal(attribute, value):
24+ return Query.add_query(attribute, "greaterThanEqual", value)
25+
26+ @staticmethod
27+ def is_null(attribute):
28+ return f'isNull("{attribute}")'
29+
30+ @staticmethod
31+ def is_not_null(attribute):
32+ return f'isNotNull("{attribute}")'
33+
34+ @staticmethod
35+ def between(attribute, start, end):
36+ return Query.add_query(attribute, "between", [start, end])
37+
38+ @staticmethod
39+ def starts_with(attribute, value):
40+ return Query.add_query(attribute, "startsWith", value)
41+
42+ @staticmethod
43+ def ends_with(attribute, value):
44+ return Query.add_query(attribute, "endsWith", value)
45+
46+ @staticmethod
47+ def select(attributes):
48+ return f'select([{",".join(map(Query.parseValues, attributes))}])'
2549
2650 @staticmethod
2751 def search(attribute, value):
28- return Query.addQuery (attribute, "search", value)
52+ return Query.add_query (attribute, "search", value)
2953
3054 @staticmethod
31- def orderAsc (attribute):
55+ def order_asc (attribute):
3256 return f'orderAsc("{attribute}")'
3357
3458 @staticmethod
35- def orderDesc (attribute):
59+ def order_desc (attribute):
3660 return f'orderDesc("{attribute}")'
3761
3862 @staticmethod
39- def cursorBefore (id):
63+ def cursor_before (id):
4064 return f'cursorBefore("{id}")'
4165
4266 @staticmethod
43- def cursorAfter (id):
67+ def cursor_after (id):
4468 return f'cursorAfter("{id}")'
4569
4670 @staticmethod
@@ -52,7 +76,7 @@ class Query:
5276 return f'offset({offset})'
5377
5478 @staticmethod
55- def addQuery (attribute, method, value):
79+ def add_query (attribute, method, value):
5680 if type(value) == list:
5781 return f'{method}("{attribute}", [{",".join(map(Query.parseValues, value))}])'
5882 else:
0 commit comments