Spaces:
Sleeping
Sleeping
Update API.py
Browse files
API.py
CHANGED
|
@@ -95,7 +95,7 @@ def APIValues():
|
|
| 95 |
head={'Content-Type':'application/json;charset=UTF-8',"Authorization":'Bearer {}'.format(key)}
|
| 96 |
response=requests.post(url="https://console.trevorsadd.co.uk/project/getprojectslist",json=query,headers=head,verify=False)
|
| 97 |
dict1=response.json()
|
| 98 |
-
|
| 99 |
return dict1
|
| 100 |
|
| 101 |
# %% [markdown]
|
|
@@ -134,7 +134,10 @@ def GenerateTables():
|
|
| 134 |
dict1 = APIValues()
|
| 135 |
|
| 136 |
# Collect data for each table
|
| 137 |
-
table1_data
|
|
|
|
|
|
|
|
|
|
| 138 |
|
| 139 |
table2_data = [
|
| 140 |
[item.get('id'), part.get('id'), part.get('name')]
|
|
@@ -218,4 +221,3 @@ def getprjSections(chosenprjid, chosenpartid):
|
|
| 218 |
|
| 219 |
|
| 220 |
# ##############################################################################
|
| 221 |
-
|
|
|
|
| 95 |
head={'Content-Type':'application/json;charset=UTF-8',"Authorization":'Bearer {}'.format(key)}
|
| 96 |
response=requests.post(url="https://console.trevorsadd.co.uk/project/getprojectslist",json=query,headers=head,verify=False)
|
| 97 |
dict1=response.json()
|
| 98 |
+
# print(dict1)
|
| 99 |
return dict1
|
| 100 |
|
| 101 |
# %% [markdown]
|
|
|
|
| 134 |
dict1 = APIValues()
|
| 135 |
|
| 136 |
# Collect data for each table
|
| 137 |
+
table1_data=[]
|
| 138 |
+
for item in dict1:
|
| 139 |
+
if not item.get('hide'):
|
| 140 |
+
table1_data.append([ item.get('id'), item.get('projectname')])
|
| 141 |
|
| 142 |
table2_data = [
|
| 143 |
[item.get('id'), part.get('id'), part.get('name')]
|
|
|
|
| 221 |
|
| 222 |
|
| 223 |
# ##############################################################################
|
|
|