中国本土应用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
998B

  1. # -*- coding: utf-8 -*-
  2. from odoo import api, models, tools, _
  3. import logging
  4. _logger = logging.getLogger(__name__)
  5. class WecomApiToolsAction(models.AbstractModel):
  6. _name = "wecomapi.tools.data"
  7. _description = "Wecom API Tools - Data"
  8. def union_data_set(self, set1, set2):
  9. """
  10. 2个数据集的并集
  11. :param set1: 数据集1
  12. :param set2: 数据集2
  13. :returns: 并集 的
  14. """
  15. # set1.union(set2)
  16. return set1 | set2
  17. def difference_data_set(self, set1, set2):
  18. """
  19. 2个数据集的差集
  20. :param set1: 数据集1
  21. :param set2: 数据集2
  22. :returns: 差集
  23. """
  24. # set1.difference(set2)
  25. return set1 - set2
  26. def intersection_data_set(self, set1, set2):
  27. """
  28. 2个数据集的交集
  29. :param set1: 数据集1
  30. :param set2: 数据集2
  31. :returns: 交集
  32. """
  33. # set1.intersection(set2)
  34. return set1 & set2
上海开阖软件有限公司 沪ICP备12045867号-1