Exemplo n.º 1
0
 # needed anyway as this is only run on 1st_run.
 # table.truncate()
 default_gis_config_values = Storage()
 default_gis_config_values.update(deployment_settings.get_gis_default_config_values())
 if not default_gis_config_values.symbology_id:
     default_gis_config_values.symbology_id = site_symbology
 if not default_gis_config_values.projection_id:
     query = db.gis_projection.name == deployment_settings.get_gis_default_projection()
     projection_id = db(query).select(db.gis_symbology.id, limitby=(0, 1)).first().id
     if projection_id:
         default_gis_config_values.projection_id = projection_id
 if not default_gis_config_values.marker_id:
     query = db.gis_marker.name == deployment_settings.get_gis_default_marker()
     marker_id = db(query).select(db.gis_marker.id, limitby=(0, 1)).first().id
     if marker_id:
         default_gis_config_values.marker_id = marker_id
 default_gis_config_values.update(gis.get_location_hierarchy_settings())
 # Since the values from deployment_settings have not been validated,
 # check them.
 errors = Storage()
 gis.config_onvalidation(default_gis_config_values, errors)
 # Do a minimal fixup of any errors.
 # If there's an error in region settings,
 # don't show it in the menu.
 if errors.region_location_id or errors.name:
     default_gis_config_values.show_in_menu = False
 # If there are missing level names, default them to Ln.
 for error in errors:
     if len(error) == 2 and error[0] == "L":
         default_gis_config_values[error] = error
 # @ToDo: Log the errors.