| Line 93... |
Line 93... |
| 93 |
else:
|
93 |
else:
|
| 94 |
associates_map.get(type)[parent_id]['pmsa_id'].append(associate_id)
|
94 |
associates_map.get(type)[parent_id]['pmsa_id'].append(associate_id)
|
| 95 |
|
95 |
|
| 96 |
|
96 |
|
| 97 |
def associates_data():
|
97 |
def associates_data():
|
| 98 |
associates = session.query(PMSA).filter(PMSA.level=='L1').all()
|
98 |
associates = session.query(PMSA).filter(PMSA.level=='L1').filter(PMSA.activated==1).all()
|
| 99 |
for associate in associates:
|
99 |
for associate in associates:
|
| 100 |
__set_relation('L1', associate.id, associate.emailId, associate.id, associate.name)
|
100 |
__set_relation('L1', associate.id, associate.emailId, associate.id, associate.name)
|
| 101 |
associates = session.query(PMSA).filter(PMSA.level=='L2').all()
|
101 |
associates = session.query(PMSA).filter(PMSA.level=='L2').filter(PMSA.activated==1).all()
|
| 102 |
for associate in associates:
|
102 |
for associate in associates:
|
| 103 |
__set_relation('L2', associate.id ,associate.emailId, associate.id, associate.name)
|
103 |
__set_relation('L2', associate.id ,associate.emailId, associate.id, associate.name)
|
| 104 |
__set_relation('L1', associate.l1_id, "", associate.id, associate.name)
|
104 |
__set_relation('L1', associate.l1_id, "", associate.id, associate.name)
|
| 105 |
associates = session.query(PMSA).filter(PMSA.level=='L3').all()
|
105 |
associates = session.query(PMSA).filter(PMSA.level=='L3').filter(PMSA.activated==1).all()
|
| 106 |
for associate in associates:
|
106 |
for associate in associates:
|
| 107 |
__set_relation('L3', associate.id,associate.emailId, associate.id, associate.name)
|
107 |
__set_relation('L3', associate.id,associate.emailId, associate.id, associate.name)
|
| 108 |
if associate.l2_id:
|
108 |
if associate.l2_id:
|
| 109 |
__set_relation('L2',associate.l2_id ,"", associate.id, associate.name)
|
109 |
__set_relation('L2',associate.l2_id ,"", associate.id, associate.name)
|
| 110 |
if associate.l1_id:
|
110 |
if associate.l1_id:
|