goodmap 1.1.2__py3-none-any.whl → 1.1.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
goodmap/db.py CHANGED
@@ -333,7 +333,7 @@ def json_file_db_get_location_obligatory_fields(db):
333
333
 
334
334
 
335
335
  def google_json_db_get_location_obligatory_fields(db):
336
- return json.loads(db.blob.download_as_text(client=None))["map"]["location_obligatory_fields"]
336
+ return db.data.get("map", {}).get("location_obligatory_fields", [])
337
337
 
338
338
 
339
339
  def mongodb_db_get_location_obligatory_fields(db):
@@ -352,7 +352,7 @@ def get_location_obligatory_fields(db):
352
352
 
353
353
 
354
354
  def google_json_db_get_data(self):
355
- return json.loads(self.blob.download_as_text(client=None))["map"]
355
+ return self.data.get("map", {})
356
356
 
357
357
 
358
358
  def json_file_db_get_data(self):
@@ -538,7 +538,7 @@ def json_file_db_get_categories(self):
538
538
 
539
539
 
540
540
  def google_json_db_get_categories(self):
541
- return json.loads(self.blob.download_as_text(client=None))["map"]["categories"].keys()
541
+ return self.data.get("map", {}).get("categories", {}).keys()
542
542
 
543
543
 
544
544
  def mongodb_db_get_categories(self):
@@ -591,17 +591,17 @@ def json_file_db_get_category_data(self, category_type=None):
591
591
 
592
592
 
593
593
  def google_json_db_get_category_data(self, category_type=None):
594
- data = json.loads(self.blob.download_as_text(client=None))["map"]
594
+ data = self.data.get("map", {})
595
595
  if category_type:
596
596
  return {
597
- "categories": {category_type: data["categories"].get(category_type, [])},
597
+ "categories": {category_type: data.get("categories", {}).get(category_type, [])},
598
598
  "categories_help": data.get("categories_help", []),
599
599
  "categories_options_help": {
600
600
  category_type: data.get("categories_options_help", {}).get(category_type, [])
601
601
  },
602
602
  }
603
603
  return {
604
- "categories": data["categories"],
604
+ "categories": data.get("categories", {}),
605
605
  "categories_help": data.get("categories_help", []),
606
606
  "categories_options_help": data.get("categories_options_help", {}),
607
607
  }
@@ -644,9 +644,7 @@ def get_location_from_raw_data(raw_data, uuid, location_model):
644
644
 
645
645
 
646
646
  def google_json_db_get_location(self, uuid, location_model):
647
- return get_location_from_raw_data(
648
- json.loads(self.blob.download_as_text(client=None))["map"], uuid, location_model
649
- )
647
+ return get_location_from_raw_data(self.data.get("map", {}), uuid, location_model)
650
648
 
651
649
 
652
650
  def json_file_db_get_location(self, uuid, location_model):
@@ -678,9 +676,7 @@ def get_locations_list_from_raw_data(map_data, query, location_model):
678
676
 
679
677
 
680
678
  def google_json_db_get_locations(self, query, location_model):
681
- return get_locations_list_from_raw_data(
682
- json.loads(self.blob.download_as_text(client=None))["map"], query, location_model
683
- )
679
+ return get_locations_list_from_raw_data(self.data.get("map", {}), query, location_model)
684
680
 
685
681
 
686
682
  def json_file_db_get_locations(self, query, location_model):
@@ -710,7 +706,7 @@ def get_locations(db, location_model):
710
706
  def google_json_db_get_locations_paginated(self, query, location_model):
711
707
  """Google JSON locations with improved pagination."""
712
708
  # Get all locations from raw data
713
- data = json.loads(self.blob.download_as_text(client=None))["map"]
709
+ data = self.data.get("map", {})
714
710
  all_locations = list(get_locations_list_from_raw_data(data, query, location_model))
715
711
  return PaginationHelper.create_paginated_response(all_locations, query)
716
712
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: goodmap
3
- Version: 1.1.2
3
+ Version: 1.1.3
4
4
  Summary: Map engine to serve all the people :)
5
5
  License-File: LICENSE.md
6
6
  Author: Krzysztof Kolodzinski
@@ -4,12 +4,12 @@ goodmap/core.py,sha256=rzMhOIYnR1jxTX6uHQJKIPLYxdUm4_v2d6LrtHtJpHU,1465
4
4
  goodmap/core_api.py,sha256=RVG4X64BSXTIzmj9mPK1DcT9p6xD00NnmX8FUaoj-uE,13277
5
5
  goodmap/data_models/location.py,sha256=H3EKozc-WZvrYm6cwajl8_gaw4rQhxdlvxR1mk4mpkA,1104
6
6
  goodmap/data_validator.py,sha256=lBmVAPxvSmEOdUGeVYSjUvVVmKfPyq4CWoHfczTtEMM,4090
7
- goodmap/db.py,sha256=y8yRwlp2TQnSgfmn3qHXOt1UPO71yqHwQN0LckcNk7o,47725
7
+ goodmap/db.py,sha256=2yZIQO6KbN6y21gxwO0xmxXIcXXrk7wqd7mgSOAefJw,47491
8
8
  goodmap/formatter.py,sha256=VlUHcK1HtM_IEU0VE3S5TOkZLVheMdakvUeW2tCKdq0,783
9
9
  goodmap/goodmap.py,sha256=q6okPopWBH6jDkKJcGDegebaapHLFUVilJ3p3aKi97k,2960
10
10
  goodmap/templates/goodmap-admin.html,sha256=39PJ1drk_xdkyzXgPZZNXYq9gA9oTVeR8hsgeae6E0g,35614
11
11
  goodmap/templates/map.html,sha256=N4N0ONzEFUS4bFtOA2jgXVbMQ7cKd1cRYIVnGLUzBIE,3995
12
- goodmap-1.1.2.dist-info/METADATA,sha256=X2grUYh0m9TtQEceRzy5knUJT6HwWyBQihyF9KmIdjs,5619
13
- goodmap-1.1.2.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
14
- goodmap-1.1.2.dist-info/licenses/LICENSE.md,sha256=nkCQOR7uheLRvHRfXmwx9LhBnMcPeBU9d4ebLojDiQU,1067
15
- goodmap-1.1.2.dist-info/RECORD,,
12
+ goodmap-1.1.3.dist-info/METADATA,sha256=CstkaPb9MW6r9Pj03bVWuCfEmW-juFPr9UGe30l3Fyo,5619
13
+ goodmap-1.1.3.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
14
+ goodmap-1.1.3.dist-info/licenses/LICENSE.md,sha256=nkCQOR7uheLRvHRfXmwx9LhBnMcPeBU9d4ebLojDiQU,1067
15
+ goodmap-1.1.3.dist-info/RECORD,,