Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
ziv17 committed Dec 16, 2023
1 parent 4f0c9a4 commit 0cdc9a5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def get_transcription(request_params: RequestParams, items: Dict):
segment_name=_(request_params.location_info.get('road_segment_name')),
)
else:
raise Exception(f"cannot convert to hebrew for resolution : {request_params.resolution.get('resolution')}")
raise Exception(f"cannot convert to hebrew for resolution : {request_params.resolution.value}")
text += "{between_years_keyword} {start_year} - {end_year}, {separator_keyword} {incidents_num} {incident_keyword}, {out_of_them_keywoard} ".format(
between_years_keyword=_("between the years"),
start_year=request_params.start_time.year,
Expand Down Expand Up @@ -170,4 +170,4 @@ def localize_items(request_params: RequestParams, items: Dict) -> Dict:
_("out of them")
_("accidents")
_(" and ")
_("in the selected time")
_("in the selected time")
14 changes: 7 additions & 7 deletions anyway/widgets/segment_junctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ def __calc_fill_segment_junctions():
rkj[t.road][t.km] = t.non_urban_intersection
tmp: List[RoadSegments] = db.session.query(RoadSegments).all()
segments = {t.segment_id: t for t in tmp}
for k, v in segments.items():
if v.road not in rkj:
logging.warning(f"No junctions in road {v.road}.")
for seg_id, seg in segments.items():
if seg.road not in rkj:
logging.warning(f"No junctions in road {seg.road}.")
continue
# logger.debug(f"seg:{k},road:{v.road}:juncs:{rkj[v.road]}.")
junctions = [rkj[v.road][km] for km in rkj[v.road].keys() if v.from_km <= km <= v.to_km]
# logger.debug(f"segment junctions:{junctions}")
res[k] = junctions
junctions = [
rkj[seg.road][km] for km in rkj[seg.road].keys() if seg.from_km <= km <= seg.to_km
]
res[seg_id] = junctions
return res
2 changes: 1 addition & 1 deletion anyway/widgets/widget_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def get_query(table_obj, filters, start_time, end_time):
return query
location_fields, other_fields = split_location_fields_and_others(filters)
if other_fields:
query = query.filter(get_expression_for_fields(filters, table_obj, and_))
query = query.filter(get_expression_for_fields(other_fields, table_obj, and_))
query = query.filter(
get_expression_for_road_segment_location_fields(location_fields, table_obj)
)
Expand Down

0 comments on commit 0cdc9a5

Please sign in to comment.