amsdal_crm 0.1.6__py3-none-any.whl → 0.1.8__py3-none-any.whl

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.
amsdal_crm/__about__.py CHANGED
@@ -1 +1 @@
1
- __version__ = '0.1.6'
1
+ __version__ = '0.1.8'
@@ -430,7 +430,6 @@ class Migration(migrations.Migration):
430
430
  "db_fields": {"pipeline": ["pipeline_partition_key"]},
431
431
  "primary_key": ["partition_key"],
432
432
  "indexed": [["order"]],
433
- "unique": [["pipeline", "name"]],
434
433
  "foreign_keys": {"pipeline": [{"pipeline_partition_key": "string"}, "Pipeline", ["partition_key"]]},
435
434
  },
436
435
  "description": "Pipeline stage model.\n\nRepresents a stage within a sales pipeline with win probability\nand closed status indicators.",
amsdal_crm/models/deal.py CHANGED
@@ -9,11 +9,17 @@ from amsdal.contrib.auth.models.user import User
9
9
  from amsdal.models.mixins import TimestampMixin
10
10
  from amsdal_models.classes.data_models.indexes import IndexInfo
11
11
  from amsdal_models.classes.model import Model
12
+ from amsdal_models.managers.model_manager import Manager
12
13
  from amsdal_utils.models.data_models.reference import Reference
13
14
  from amsdal_utils.models.enums import ModuleType
14
15
  from pydantic.fields import Field
15
16
 
16
17
 
18
+ class DealManager(Manager):
19
+ def get_queryset(self) -> 'DealManager':
20
+ return super().get_queryset().select_related('stage')
21
+
22
+
17
23
  class Deal(TimestampMixin, Model):
18
24
  """Deal (Sales Opportunity) model.
19
25
 
@@ -2,14 +2,19 @@
2
2
 
3
3
  from typing import ClassVar
4
4
 
5
- from amsdal_models.classes.data_models.constraints import UniqueConstraint
6
5
  from amsdal_models.classes.data_models.indexes import IndexInfo
7
6
  from amsdal_models.classes.model import Model
7
+ from amsdal_models.managers.model_manager import Manager
8
8
  from amsdal_utils.models.enums import ModuleType
9
9
  from pydantic import ConfigDict
10
10
  from pydantic.fields import Field
11
11
 
12
12
 
13
+ class StageManager(Manager):
14
+ def get_queryset(self) -> 'StageManager':
15
+ return super().get_queryset().select_related('pipeline')
16
+
17
+
13
18
  class Stage(Model):
14
19
  """Pipeline stage model.
15
20
 
@@ -19,10 +24,9 @@ class Stage(Model):
19
24
 
20
25
  model_config: ClassVar[ConfigDict] = ConfigDict(arbitrary_types_allowed=True)
21
26
 
27
+ objects = StageManager()
28
+
22
29
  __module_type__: ClassVar[ModuleType] = ModuleType.CONTRIB
23
- __constraints__: ClassVar[list[UniqueConstraint]] = [
24
- UniqueConstraint(name='unq_stage_pipeline_name', fields=['pipeline', 'name'])
25
- ]
26
30
  __indexes__: ClassVar[list[IndexInfo]] = [
27
31
  IndexInfo(name='idx_stage_order', field='order'),
28
32
  ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: amsdal_crm
3
- Version: 0.1.6
3
+ Version: 0.1.8
4
4
  Summary: amsdal-crm plugin for AMSDAL Framework
5
5
  Requires-Python: >=3.11
6
6
  Requires-Dist: aiohttp==3.12.15
@@ -1,5 +1,5 @@
1
1
  amsdal_crm/Third-Party Materials - AMSDAL Dependencies - License Notices.md,sha256=ML7PqsHrTMNNZn8E_rA-LzDCAafMSxMcrmSg8YOi-wo,113896
2
- amsdal_crm/__about__.py,sha256=gW5NUxwGdPsiQjn0cOuuQT11pfthByI5DITDg_HMhLQ,22
2
+ amsdal_crm/__about__.py,sha256=rq5OMW-khxQo_5FAvSrPaAS1lRfG9aG2hSuo-KK2Yfk,22
3
3
  amsdal_crm/__init__.py,sha256=b4wxJYesA5Ctk1IrAvlw64i_0EU3SiK1Tw6sUYakd18,303
4
4
  amsdal_crm/app.py,sha256=JLvueh_2KURQLDWMQlq4Z6gAFsqBDTRf6pK095ehp14,1373
5
5
  amsdal_crm/constants.py,sha256=5Ga7q9zEKcQZnAoKv_SE_7w8WxvhPFkM9gY9NruOEaA,347
@@ -10,16 +10,16 @@ amsdal_crm/fixtures/permissions.py,sha256=cYA-gWkKQdoN79GymQVHtT0GyFXMzaskwp13Ie
10
10
  amsdal_crm/fixtures/pipelines.py,sha256=ZCLmgrA700Sl7Oy7l4IQ8FbIbC1378OkcJTrZe5701o,2064
11
11
  amsdal_crm/lifecycle/__init__.py,sha256=B8nw19lEIr7U15Lnu6jh7yzZwF9LWWh4-p3X63sAicQ,31
12
12
  amsdal_crm/lifecycle/consumer.py,sha256=NhfFsbQeQUfCb9Mz-YBRZjKHL-annAqHt6Gc9b-I9_g,8824
13
- amsdal_crm/migrations/0000_initial.py,sha256=12-oowQi6e1yRKe9VMMnpD3gyIMKhOvkzFsO7ZeumFA,57084
13
+ amsdal_crm/migrations/0000_initial.py,sha256=OKa-QrcE6DIzrHCRvYvmJDXGve83fVl9wOxqENnIbaE,57030
14
14
  amsdal_crm/models/__init__.py,sha256=DSuGeLKPNL_EUGohWtrH6Eof6Nk--dHyZpfqbGWmYIY,1350
15
15
  amsdal_crm/models/account.py,sha256=prb8Tl0nYyObTeql1fLX1cVRszauzPRSN7xv-H26hRg,4918
16
16
  amsdal_crm/models/activity.py,sha256=UtO1--oSPfrQCfQwWfIlEkjdXuaRG9znesPrGe1JqGM,4775
17
17
  amsdal_crm/models/attachment.py,sha256=CzS8sUMw0_8T_a4Ey6uzrSdEc12Fki5FbrFRXrsTExk,1525
18
18
  amsdal_crm/models/contact.py,sha256=xOTl8zUIEm2_Tk-CQxGAjzR_iuLA7Q_aKmJZAMXZ1F0,4924
19
19
  amsdal_crm/models/custom_field_definition.py,sha256=Z0k_QR6rZ1hWkg4Wn-w8Rn9GSIgpOg_moUYRsmRPZQI,1666
20
- amsdal_crm/models/deal.py,sha256=kEmS_nkicWKhZO1PbeAJLYbAffdo6LU8Nm5xDQDOwkA,6448
20
+ amsdal_crm/models/deal.py,sha256=5Vh-3m909m9qhJO3Sqwebuf1UBOxB4s0K2RKrw4daps,6642
21
21
  amsdal_crm/models/pipeline.py,sha256=DXJh5MbCCRctEHhDfxef5RxFWSKN0D4v6UK75q5ssL8,925
22
- amsdal_crm/models/stage.py,sha256=Ch4O1Aj2LtBhGpDN7MqY4iNRPrEQig0q6QtEU5cp4hA,1608
22
+ amsdal_crm/models/stage.py,sha256=LWG0Kr58srfqCrxjzRlrJogxpWbKvBOvkiHPbxVElbM,1612
23
23
  amsdal_crm/models/workflow_rule.py,sha256=cnIEaX-hWcRYvN5gR4uPt7Cirr8sPPdJibZapD8VRpY,1547
24
24
  amsdal_crm/services/__init__.py,sha256=ngHA-MUPrsHvga8vFP61b8v7rrAWl-h1VZTjhlJCXkI,465
25
25
  amsdal_crm/services/activity_service.py,sha256=3iuEmaSicwm81rouLPum5VaWW0bAMnNWNPRCHkNhewU,1873
@@ -27,6 +27,6 @@ amsdal_crm/services/custom_field_service.py,sha256=r2dr2gijTbi9r56XV64bSArx0jTGw
27
27
  amsdal_crm/services/deal_service.py,sha256=ZF7cAc6r10xgXZ8D8Oy3hnE-6GgAXq8fuG_Y4QerRGw,4839
28
28
  amsdal_crm/services/email_service.py,sha256=kung83otZAzm5MjezbWFP_Bp9CJ2NXLlDdjMX9MvNIc,3788
29
29
  amsdal_crm/services/workflow_service.py,sha256=oKOFJrwnMZxAiHuScs63tZxL801z-6ryrUuPMC7OXlE,7036
30
- amsdal_crm-0.1.6.dist-info/METADATA,sha256=dDPCm9jmbB4FaSivwFWJCwwsIQflx_adJBgN53VVFAs,1596
31
- amsdal_crm-0.1.6.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
32
- amsdal_crm-0.1.6.dist-info/RECORD,,
30
+ amsdal_crm-0.1.8.dist-info/METADATA,sha256=1pWUuqh_4RWpPnt__VYRsxL2nT0Lgs0AXM-rtKunjVQ,1596
31
+ amsdal_crm-0.1.8.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
32
+ amsdal_crm-0.1.8.dist-info/RECORD,,