cloudoll 2.2.28__tar.gz → 2.2.29__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {cloudoll-2.2.28 → cloudoll-2.2.29}/PKG-INFO +1 -1
- cloudoll-2.2.29/cloudoll/__init__.py +1 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/orm/field.py +19 -1
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/utils/m2d.py +1 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/web/__init__.py +1 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll.egg-info/PKG-INFO +1 -1
- cloudoll-2.2.28/cloudoll/__init__.py +0 -1
- {cloudoll-2.2.28 → cloudoll-2.2.29}/LICENSE +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/README.md +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/__main__.py +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/cli.py +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/error/__init__.py +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/error/errors.py +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/logging/__init__.py +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/mail/__init__.py +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/mail/smtp.py +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/orm/__init__.py +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/orm/base.py +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/orm/err.py +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/orm/model.py +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/orm/mysql.py +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/orm/parse.py +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/orm/postgres.py +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/robot/__init__.py +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/robot/dingtalk.py +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/robot/feishu.py +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/robot/slack.py +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/utils/__init__.py +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/utils/common.py +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/utils/patch_loop.py +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/utils/snowflake.py +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/utils/watch.py +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/web/exception.py +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/web/html.py +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/web/http.py +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/web/jwt.py +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll/web/settings.py +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll.egg-info/SOURCES.txt +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll.egg-info/dependency_links.txt +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll.egg-info/entry_points.txt +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll.egg-info/requires.txt +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/cloudoll.egg-info/top_level.txt +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/setup.cfg +0 -0
- {cloudoll-2.2.28 → cloudoll-2.2.29}/setup.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.2.29"
|
|
@@ -31,6 +31,8 @@ OP = objdict(
|
|
|
31
31
|
AVG="AVG",
|
|
32
32
|
AS="AS",
|
|
33
33
|
SUM="SUM",
|
|
34
|
+
MAX="MAX",
|
|
35
|
+
MIN="MIN",
|
|
34
36
|
IS_TODAY="IS_TODAY",
|
|
35
37
|
IS_THIS_WEEK="THIS_WEEK",
|
|
36
38
|
IS_THIS_MONTH="THIS_MONTH",
|
|
@@ -50,6 +52,7 @@ OP = objdict(
|
|
|
50
52
|
DATE_FORMAT="DATE_FORMAT",
|
|
51
53
|
JSON_CONTAINS_OBJECT="JSON_CONTAINS_OBJECT",
|
|
52
54
|
JSON_CONTAINS_ARRAY="JSON_CONTAINS_ARRAY",
|
|
55
|
+
GROUP_CONCAT='GROUP_CONCAT',
|
|
53
56
|
COUNT="COUNT",
|
|
54
57
|
COUNT_WHEN="COUNT_WHEN",
|
|
55
58
|
IS_NOT="IS NOT",
|
|
@@ -119,6 +122,9 @@ class FieldBase(object):
|
|
|
119
122
|
def count(self):
|
|
120
123
|
return Function(self, OP.COUNT)
|
|
121
124
|
|
|
125
|
+
def max(self):
|
|
126
|
+
return Function(self, OP.MAX)
|
|
127
|
+
|
|
122
128
|
def count_when(self, value):
|
|
123
129
|
return Function(self, OP.COUNT_WHEN, value)
|
|
124
130
|
|
|
@@ -284,7 +290,9 @@ class Function(FieldBase):
|
|
|
284
290
|
return f"{col_name} < NOW() - INTERVAL {self.rpt} MINUTE", None
|
|
285
291
|
elif op == OP.BEFORE_SECONDS:
|
|
286
292
|
return f"{col_name} < NOW() - INTERVAL {self.rpt} SECOND", None
|
|
287
|
-
|
|
293
|
+
elif op == OP.CONTAINS:
|
|
294
|
+
return f"{col_name} LIKE CONCAT('%%',?,'%%')", [self.rpt]
|
|
295
|
+
# return f"CONTAINS({col_name},?)", [self.rpt]
|
|
288
296
|
elif op == OP.JSON_CONTAINS_OBJECT:
|
|
289
297
|
_k, _v = self.rpt
|
|
290
298
|
key = _k.full_name if isinstance(_k, Field) else f"'{_k}'"
|
|
@@ -300,6 +308,16 @@ class Function(FieldBase):
|
|
|
300
308
|
return f"COUNT({col_name})", None
|
|
301
309
|
elif op == OP.COUNT_WHEN:
|
|
302
310
|
return f"COUNT(CASE WHEN {col_name} = ? THEN 1 END)", [self.rpt]
|
|
311
|
+
elif op == OP.SUM:
|
|
312
|
+
return f"SUM({col_name})", None
|
|
313
|
+
elif op == OP.AVG:
|
|
314
|
+
return f"AVG({col_name})", None
|
|
315
|
+
elif op == OP.MAX:
|
|
316
|
+
return f"MAX({col_name})", None
|
|
317
|
+
elif op == OP.MIN:
|
|
318
|
+
return f"MIN({col_name})", None
|
|
319
|
+
elif op == OP.GROUP_CONCAT:
|
|
320
|
+
return f"GROUP_CONCAT({col_name})", None
|
|
303
321
|
|
|
304
322
|
|
|
305
323
|
class Expression(FieldBase):
|
|
@@ -201,6 +201,7 @@ def get_col(field, driver="mysql"):
|
|
|
201
201
|
"default": field["Default"],
|
|
202
202
|
"charset": field["Collation"],
|
|
203
203
|
"max_length": None,
|
|
204
|
+
"scale_length":None,
|
|
204
205
|
"auto_increment": field["Extra"] == "auto_increment",
|
|
205
206
|
"NOT_NULL": field["Null"] == "NO",
|
|
206
207
|
"created_generated": "DEFAULT_GENERATED" == field["Extra"],
|
|
@@ -234,6 +234,7 @@ class Application(object):
|
|
|
234
234
|
self.app.on_startup.append(self._init_database)
|
|
235
235
|
self.app.on_cleanup.append(self._close_database)
|
|
236
236
|
self.app.config = config
|
|
237
|
+
self.app.env = env
|
|
237
238
|
self.app.jwt_encode = self.jwt_encode
|
|
238
239
|
self.app.jwt_decode = self.jwt_decode
|
|
239
240
|
# session
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.2.28"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|