Coverage for apps/proxy_models/managers.py: 35%
31 statements
« prev ^ index » next coverage.py v6.4.4, created at 2024-07-15 11:02 -0600
« prev ^ index » next coverage.py v6.4.4, created at 2024-07-15 11:02 -0600
1from django.db import models
4class ClientManager(models.Manager):
6 def get_queryset(self):
7 qs_base = super().get_queryset()
8 # qs1 = qs_base.filter(clipar7='7C03', clicod__startswith='M')
9 qs1 = qs_base.filter(clipar7='7C03')
10 qs_result = qs1
11 return qs_result
15class SalesmanManager(models.Manager):
17 def get_queryset(self):
18 qs_base = super().get_queryset()
19 qs1 = qs_base.filter(agt=1)
20 qs1 = qs1.exclude(agdescr__istartswith='Casa ')
21 qs1 = qs1.exclude(agdescr__istartswith='casa ')
22 qs1 = qs1.exclude(agdescr__istartswith='CASA ')
23 qs1 = qs1.exclude(agdescr__istartswith='Venta ')
24 qs1 = qs1.exclude(agdescr__istartswith='Venta')
25 qs_result = qs1
26 return qs_result
30class StoreManager(models.Manager):
32 def get_queryset(self):
33 catalm_exclusion_list = [
34 '00', '216', '092', '093', '097', '098', '100'
35 ]
36 catzona_exclusion_list = [
37 '99'
38 ]
39 qs_base = super().get_queryset()
40 qs1 = qs_base.filter(catalm__lte=300, catalm__gte=1)
41 qs2 = qs_base.filter(catalm__startswith='00')
42 qs3 = qs_base.filter(catalm__startswith='0')
43 joint_qs = qs1 | qs2 | qs3
44 joint_qs = joint_qs.exclude(catzona__in=catzona_exclusion_list)
45 joint_qs = joint_qs.exclude(catalm__in=catalm_exclusion_list)
46 qs_result = joint_qs
47 return qs_result