|
@@ 786-803 (lines=18) @@
|
| 783 |
|
cursor.execute(query, (id_, )) |
| 784 |
|
rows_spaces = cursor.fetchall() |
| 785 |
|
|
| 786 |
|
if rows_spaces is not None and len(rows_spaces) > 0: |
| 787 |
|
for row in rows_spaces: |
| 788 |
|
timezone = timezone_dict.get(row['timezone_id'], None) |
| 789 |
|
contact = contact_dict.get(row['contact_id'], None) |
| 790 |
|
cost_center = cost_center_dict.get(row['cost_center_id'], None) |
| 791 |
|
parent_space = space_dict.get(row['parent_space_id'], None) |
| 792 |
|
meta_result = {"id": row['id'], |
| 793 |
|
"name": row['name'], |
| 794 |
|
"uuid": row['uuid'], |
| 795 |
|
"parent_space": parent_space, |
| 796 |
|
"area": row['area'], |
| 797 |
|
"timezone": timezone, |
| 798 |
|
"is_input_counted": bool(row['is_input_counted']), |
| 799 |
|
"is_output_counted": bool(row['is_output_counted']), |
| 800 |
|
"contact": contact, |
| 801 |
|
"cost_center": cost_center, |
| 802 |
|
"description": row['description']} |
| 803 |
|
result['children'].append(meta_result) |
| 804 |
|
|
| 805 |
|
cursor.close() |
| 806 |
|
cnx.disconnect() |
|
@@ 82-99 (lines=18) @@
|
| 79 |
|
rows_spaces = cursor.fetchall() |
| 80 |
|
|
| 81 |
|
result = list() |
| 82 |
|
if rows_spaces is not None and len(rows_spaces) > 0: |
| 83 |
|
for row in rows_spaces: |
| 84 |
|
timezone = timezone_dict.get(row['timezone_id'], None) |
| 85 |
|
contact = contact_dict.get(row['contact_id'], None) |
| 86 |
|
cost_center = cost_center_dict.get(row['cost_center_id'], None) |
| 87 |
|
parent_space = space_dict.get(row['parent_space_id'], None) |
| 88 |
|
meta_result = {"id": row['id'], |
| 89 |
|
"name": row['name'], |
| 90 |
|
"uuid": row['uuid'], |
| 91 |
|
"parent_space": parent_space, |
| 92 |
|
"area": row['area'], |
| 93 |
|
"timezone": timezone, |
| 94 |
|
"is_input_counted": bool(row['is_input_counted']), |
| 95 |
|
"is_output_counted": bool(row['is_output_counted']), |
| 96 |
|
"contact": contact, |
| 97 |
|
"cost_center": cost_center, |
| 98 |
|
"description": row['description']} |
| 99 |
|
result.append(meta_result) |
| 100 |
|
|
| 101 |
|
cursor.close() |
| 102 |
|
cnx.disconnect() |