cloudoll 2.2.30__tar.gz → 2.2.31__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.
Files changed (44) hide show
  1. {cloudoll-2.2.30 → cloudoll-2.2.31}/PKG-INFO +1 -1
  2. cloudoll-2.2.31/cloudoll/__init__.py +1 -0
  3. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/orm/field.py +18 -3
  4. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll.egg-info/PKG-INFO +1 -1
  5. cloudoll-2.2.30/cloudoll/__init__.py +0 -1
  6. {cloudoll-2.2.30 → cloudoll-2.2.31}/LICENSE +0 -0
  7. {cloudoll-2.2.30 → cloudoll-2.2.31}/README.md +0 -0
  8. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/__main__.py +0 -0
  9. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/cli.py +0 -0
  10. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/error/__init__.py +0 -0
  11. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/error/errors.py +0 -0
  12. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/logging/__init__.py +0 -0
  13. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/mail/__init__.py +0 -0
  14. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/mail/smtp.py +0 -0
  15. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/orm/__init__.py +0 -0
  16. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/orm/base.py +0 -0
  17. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/orm/err.py +0 -0
  18. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/orm/model.py +0 -0
  19. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/orm/mysql.py +0 -0
  20. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/orm/parse.py +0 -0
  21. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/orm/postgres.py +0 -0
  22. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/robot/__init__.py +0 -0
  23. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/robot/dingtalk.py +0 -0
  24. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/robot/feishu.py +0 -0
  25. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/robot/slack.py +0 -0
  26. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/utils/__init__.py +0 -0
  27. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/utils/common.py +0 -0
  28. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/utils/m2d.py +0 -0
  29. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/utils/patch_loop.py +0 -0
  30. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/utils/snowflake.py +0 -0
  31. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/utils/watch.py +0 -0
  32. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/web/__init__.py +0 -0
  33. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/web/exception.py +0 -0
  34. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/web/html.py +0 -0
  35. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/web/http.py +0 -0
  36. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/web/jwt.py +0 -0
  37. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll/web/settings.py +0 -0
  38. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll.egg-info/SOURCES.txt +0 -0
  39. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll.egg-info/dependency_links.txt +0 -0
  40. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll.egg-info/entry_points.txt +0 -0
  41. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll.egg-info/requires.txt +0 -0
  42. {cloudoll-2.2.30 → cloudoll-2.2.31}/cloudoll.egg-info/top_level.txt +0 -0
  43. {cloudoll-2.2.30 → cloudoll-2.2.31}/setup.cfg +0 -0
  44. {cloudoll-2.2.30 → cloudoll-2.2.31}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cloudoll
3
- Version: 2.2.30
3
+ Version: 2.2.31
4
4
  Summary: 辅助快速创建可分布的微服务。
5
5
  Home-page: https://gitee.com/chuchur/cloudoll-py
6
6
  Author: chuchur
@@ -0,0 +1 @@
1
+ __version__ = "2.2.31"
@@ -52,7 +52,6 @@ OP = objdict(
52
52
  DATE_FORMAT="DATE_FORMAT",
53
53
  JSON_CONTAINS_OBJECT="JSON_CONTAINS_OBJECT",
54
54
  JSON_CONTAINS_ARRAY="JSON_CONTAINS_ARRAY",
55
- GROUP_CONCAT='GROUP_CONCAT',
56
55
  COUNT="COUNT",
57
56
  COUNT_WHEN="COUNT_WHEN",
58
57
  SUM_WHEN="SUM_WHEN",
@@ -70,6 +69,7 @@ OP = objdict(
70
69
  NOT_BETWEEN="NOT BETWEEN",
71
70
  REGEXP="REGEXP",
72
71
  IREGEXP="IREGEXP",
72
+ GROUP_CONCAT="GROUP_CONCAT",
73
73
  DISTINCT="DISTINCT",
74
74
  CONCAT="||",
75
75
  BITWISE_NEGATION="~",
@@ -114,8 +114,11 @@ class FieldBase(object):
114
114
  ilike = _op(OP.ILIKE) # ilike for pg
115
115
  not_like = _op(OP.NOT_LIKE) # not like
116
116
 
117
+ def group_concat(self, *arg):
118
+ return Function(self, OP.GROUP_CONCAT, arg)
119
+
117
120
  def distinct(self, *arg):
118
- return Expression(self, OP.DISTINCT, arg)
121
+ return Function(self, OP.DISTINCT, arg)
119
122
 
120
123
  def desc(self):
121
124
  return Expression(self, OP.DESC, None)
@@ -380,7 +383,19 @@ class Function(FieldBase):
380
383
  c, v, v1, v2 = deconstruct(self.rpt)
381
384
  return f"MIN(CASE WHEN {c} THEN {v1} ELSE {v2} END)", [v]
382
385
  elif op == OP.GROUP_CONCAT:
383
- return f"GROUP_CONCAT({col_name})", None
386
+ arg = self.rpt
387
+ extra = None
388
+ if len(arg) == 0:
389
+ extra = col_name
390
+ elif len(arg) == 1 and isinstance(arg[0], FieldBase):
391
+ extra = f"{arg[0].op} {arg[0].col.name}"
392
+ else:
393
+ # todo : DISTINCT name ORDER BY name ASC SEPARATOR '; '
394
+ extra = col_name
395
+
396
+ return f"GROUP_CONCAT({extra})", None
397
+ elif op == OP.DISTINCT:
398
+ return f"DISTINCT {col_name}", None
384
399
 
385
400
 
386
401
  class Expression(FieldBase):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cloudoll
3
- Version: 2.2.30
3
+ Version: 2.2.31
4
4
  Summary: 辅助快速创建可分布的微服务。
5
5
  Home-page: https://gitee.com/chuchur/cloudoll-py
6
6
  Author: chuchur
@@ -1 +0,0 @@
1
- __version__ = "2.2.30"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes