nastasiasnk commited on
Commit
522ea95
·
verified ·
1 Parent(s): 0ac30f2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -30
app.py CHANGED
@@ -21,8 +21,6 @@ from config import landuseDatabaseId , subdomainAttributesDatabaseId
21
  from imports_utils import fetch_all_database_pages
22
  from imports_utils import get_property_value
23
  from imports_utils import notion
24
-
25
-
26
  from config import landuseColumnName
27
  from config import subdomainColumnName
28
  from config import sqmPerEmployeeColumnName
@@ -34,37 +32,13 @@ from config import domainColumnName
34
  landuse_attributes = fetch_all_database_pages(notion, landuseDatabaseId)
35
  livability_attributes = fetch_all_database_pages(notion, subdomainAttributesDatabaseId)
36
 
37
- # fetch the dictionary with landuse - domain pairs
38
- landuseMapperDict ={}
39
- subdomains_unique = []
40
 
41
- for page in landuse_attributes:
42
- value_landuse = get_property_value(page, landuseColumnName)
43
- value_subdomain = get_property_value(page, subdomainColumnName)
44
- if value_subdomain and value_landuse:
45
- landuseMapperDict[value_landuse] = value_subdomain
46
- if value_subdomain != "":
47
- subdomains_unique.append(value_subdomain)
48
 
49
  # fetch the dictionary with subdomain attribute data
50
- attributeMapperDict ={}
51
- domains_unique = []
52
-
53
- for page in livability_attributes:
54
- subdomain = get_property_value(page, subdomainColumnName)
55
- sqm_per_employee = get_property_value(page, sqmPerEmployeeColumnName)
56
- thresholds = get_property_value(page, thresholdsColumnName)
57
- max_points = get_property_value(page, maxPointsColumnName)
58
- domain = get_property_value(page, domainColumnName)
59
- if thresholds:
60
- attributeMapperDict[subdomain] = {
61
- 'sqmPerEmpl': sqm_per_employee if sqm_per_employee != "" else 0,
62
- 'thresholds': thresholds,
63
- 'max_points': max_points,
64
- 'domain': [domain if domain != "" else 0]
65
- }
66
- if domain != "":
67
- domains_unique.append(domain)
68
 
69
 
70
 
 
21
  from imports_utils import fetch_all_database_pages
22
  from imports_utils import get_property_value
23
  from imports_utils import notion
 
 
24
  from config import landuseColumnName
25
  from config import subdomainColumnName
26
  from config import sqmPerEmployeeColumnName
 
32
  landuse_attributes = fetch_all_database_pages(notion, landuseDatabaseId)
33
  livability_attributes = fetch_all_database_pages(notion, subdomainAttributesDatabaseId)
34
 
 
 
 
35
 
36
+ landuseMapperDict = fetchDomainMapper (landuse_attributes)
37
+ # fetch the dictionary with landuse - domain pairs
 
 
 
 
 
38
 
39
  # fetch the dictionary with subdomain attribute data
40
+
41
+ attributeMapperDict = fetchSubdomainMapper (livability_attributes)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
 
43
 
44