From bf0239f4c74afbe5a4d6cf85518c46fd7f7dc02f Mon Sep 17 00:00:00 2001 From: tkalir Date: Thu, 14 Sep 2023 16:36:13 +0300 Subject: [PATCH 1/4] fixed order and "unkown" label for killed_and_injured_count_per_age_group widgets --- ..._and_injured_count_per_age_group_widget.py | 5 +- ...njured_count_per_age_group_widget_utils.py | 11 +++- babel.cfg | 2 +- messages.pot | 45 ++++++++------- translations/he/LC_MESSAGES/messages.mo | Bin 11739 -> 11777 bytes translations/he/LC_MESSAGES/messages.po | 53 ++++++++++-------- 6 files changed, 68 insertions(+), 48 deletions(-) diff --git a/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py b/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py index 1dc05c8b9..c2c3bb531 100644 --- a/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py +++ b/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py @@ -10,7 +10,7 @@ from anyway.widgets.road_segment_widgets import killed_and_injured_count_per_age_group_widget_utils from anyway.widgets.road_segment_widgets.road_segment_widget import RoadSegmentWidget from anyway.widgets.widget import register - +import logging @register class KilledInjuredCountPerAgeGroupWidget(RoadSegmentWidget): @@ -32,9 +32,10 @@ def generate_items(self) -> None: count_total += count structured_data_list.append({BE.LKEY: age_group, BE.VAL: count_total}) - + #KilledInjuredCountPerAgeGroupWidget.prepare_data_for_ui(structured_data_list) self.items = structured_data_list + @staticmethod def localize_items(request_params: RequestParams, items: Dict) -> Dict: items["data"]["text"] = { diff --git a/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget_utils.py b/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget_utils.py index 27c21ec56..bff36a9b8 100644 --- a/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget_utils.py +++ b/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget_utils.py @@ -5,6 +5,9 @@ from flask_sqlalchemy import BaseQuery from sqlalchemy import func, asc +from flask_babel import _ +import logging + from anyway.app_and_db import db from anyway.backend_constants import BE_CONST, InjurySeverity from anyway.models import InvolvedMarkerView @@ -48,6 +51,8 @@ def filter_and_group_injured_count_per_age_group( cache_dict.popitem(last=False) cache_dict[cache_key] = dict_grouped + logging.debug("groooo") + logging.debug(dict_grouped) return dict_grouped @staticmethod @@ -79,11 +84,11 @@ def defaultdict_int_factory() -> Callable: break if not found_age_range: - dict_grouped[UNKNOWN][injury_id] += count - + dict_grouped[UNKNOWN ][injury_id] += count # Rename the last key dict_grouped[SIXTY_FIVE_PLUS] = dict_grouped[SIXTY_TWOHUNDRED] del dict_grouped[SIXTY_TWOHUNDRED] + dict_grouped[_("unknown")] = dict_grouped.pop(UNKNOWN) return dict_grouped, has_data @staticmethod @@ -121,4 +126,4 @@ def create_query_for_killed_and_injured_count_per_age_group( ) .order_by(asc(InvolvedMarkerView.age_group)) ) - return query + return query \ No newline at end of file diff --git a/babel.cfg b/babel.cfg index 98af24546..c8a8cc57e 100644 --- a/babel.cfg +++ b/babel.cfg @@ -2,7 +2,7 @@ [python: **.py] [jinja2: **/templates/**.html] -extensions=jinja2.ext.autoescape,jinja2.ext.with_,jinja2.ext.i18n,jinja2.ext.do,webassets.ext.jinja2.AssetsExtension +extensions=jinja2.ext.i18n,jinja2.ext.do,webassets.ext.jinja2.AssetsExtension encoding = utf-8 silent=0 diff --git a/messages.pot b/messages.pot index 236ee2cd9..050a5cd8a 100644 --- a/messages.pot +++ b/messages.pot @@ -8,14 +8,14 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2023-06-22 13:32+0000\n" +"POT-Creation-Date: 2023-09-14 15:58+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.10.3\n" +"Generated-By: Babel 2.12.1\n" #: anyway/backend_constants.py:148 msgid "killed" @@ -29,11 +29,11 @@ msgstr "" msgid "light injured" msgstr "" -#: anyway/flask_app.py:678 anyway/flask_app.py:782 +#: anyway/flask_app.py:682 anyway/flask_app.py:786 msgid "Discussion not found:" msgstr "" -#: anyway/flask_app.py:681 +#: anyway/flask_app.py:685 msgid "Illegal Discussion" msgstr "" @@ -263,7 +263,21 @@ msgid "Number of accidents by severity" msgstr "" #: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:123 -msgid "road_segment_namenon_urban_intersection_hebrew" +#: anyway/widgets/road_segment_widgets/accident_count_by_accident_year_widget.py:57 +#: anyway/widgets/road_segment_widgets/accident_count_by_car_type_widget.py:145 +#: anyway/widgets/road_segment_widgets/accident_count_by_hour_widget.py:31 +#: anyway/widgets/road_segment_widgets/accident_count_by_road_light_widget.py:33 +#: anyway/widgets/road_segment_widgets/accidents_heat_map_widget.py:54 +#: anyway/widgets/road_segment_widgets/injured_count_by_accident_year_widget.py:56 +#: anyway/widgets/road_segment_widgets/injured_count_by_severity_widget.py:133 +#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_stacked_widget.py:53 +#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:50 +#: anyway/widgets/road_segment_widgets/suburban_crosswalk_widget.py:73 +msgid "road_segment_name" +msgstr "" + +#: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:124 +msgid "non_urban_intersection_hebrew" msgstr "" #: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:129 @@ -407,19 +421,6 @@ msgstr "" msgid "Accidents in segment" msgstr "" -#: anyway/widgets/road_segment_widgets/accident_count_by_accident_year_widget.py:57 -#: anyway/widgets/road_segment_widgets/accident_count_by_car_type_widget.py:145 -#: anyway/widgets/road_segment_widgets/accident_count_by_hour_widget.py:31 -#: anyway/widgets/road_segment_widgets/accident_count_by_road_light_widget.py:33 -#: anyway/widgets/road_segment_widgets/accidents_heat_map_widget.py:54 -#: anyway/widgets/road_segment_widgets/injured_count_by_accident_year_widget.py:56 -#: anyway/widgets/road_segment_widgets/injured_count_by_severity_widget.py:133 -#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_stacked_widget.py:53 -#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:42 -#: anyway/widgets/road_segment_widgets/suburban_crosswalk_widget.py:73 -msgid "road_segment_name" -msgstr "" - #: anyway/widgets/road_segment_widgets/accident_count_by_accident_year_widget.py:63 msgid "" "Fatal, severe and light accidents count in the specified years, split by " @@ -580,7 +581,13 @@ msgstr "" msgid "Killed and injury stacked per age group" msgstr "" -#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:41 +#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:29 +#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget_utils.py:87 +#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget_utils.py:91 +msgid "unknown" +msgstr "" + +#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:49 msgid "Injury per age group" msgstr "" diff --git a/translations/he/LC_MESSAGES/messages.mo b/translations/he/LC_MESSAGES/messages.mo index 161092884ae5c4559a925fa211fe482543882a0d..4861651221ae3824fedfeecac0a5c7be7904aaea 100644 GIT binary patch delta 2251 zcmYM#3uu*P9LMqhZtl`9xps5TJkHD9=Gpb^;!K(85>wP7HO);~DClStZMBj1vb1m+ zQ<%dn(KwC333-`OM35_@h)!8jhl-rSh@cG(O^_n}{(K*3Z0Gab-sky0|L1wneto8A zlXoREe!%#7jlTl^R>rIL|IeNzvjnPpQT_X{2;afU_!Va1FPMzi@nO7!`Itwe>eV<6 zpTwEC6Q`Sbc7#GH4HqyEuVNwI!A2}dF$-cdcHlwm#((fT?0mp%2{xsgt;1f_0#{Mb z#i#l6S2Ft9C#ao{qB3v`m6?JJv$a@=o3INv z;*S`>iU<7wp1@hu_oC(t<5bqSFDT5wYe-5gj=V0wnfN$vMlCdinRph9@pI(YCiu|N z+{H>PV36voP?=~$9mOG>jYAm1OX$^8NO;Ik^&-5V0i@6NV+kI`R{RXL;B3;s=~$g} zF{*t92Cx~Y;>)P{-a<~vPNFt)8cB|w%Od|Ala0{8aoV?-h(BX2UUT&^=eYA0YW%;b zKoYb4qnV7{JDY=QFGtNcA2}^s?E2T>B+EA%~0ku#sYJsDuhzC)r zJdL`XAG-SYs2%=>{MtAloR-BAwai5wMJZ}S6{x_xS_+zY5h~&))I{r$&DmB|ATOcD z^}7DUsGXifO+18}@C+V`Au!jzj41V5uS8wGt*E!_ATq?WQxvq|2rA{5P)BeR^*}aP zSM>#`TinctZgm&d;Bi;~!Fd~7XwT;c>bY)w6W_*j7~<6k65#K+R_}inUr(>lu>&8$ z39QBv-o;{U!KHWrcVGn1V|~DE0RKc~qKDNQ@eR~QB3OnuP#c*}qv}nl@z3K` z4{u;tb+$JP3;8I*WvCr@;5_Vi^^2~5%$dq6we*K@AGV>6>^dsLx3Liu=J?+akD*7K zJxgIZ_M#%ZjCB~x>db8os8nyp^*DfCIDxBh+gyJ~AD}MpMGWC()VL(lsJqmI_b)T* zQVtfAf8G9%Xwaqj8Uy$TCSh`kfB7;|4+c#5#pQ1MIjZsiUF+txv)Pm*CC8$8wJGVHuqZZhOys6fW3ZNhL{ClqcG3xn<^CwKD zK8ie_V&fFjXt+7NJ*hS$v9rCcz2n99{u8;aY4d}Xp+IF#Lrr~YMfGr6-n5vwswM4iJm-AR_nhal zt@&z`KbA3ZpYii9e|h{Zo~Y>mpLGGVNrY{v>zl9`-^VF<3N!I*d;ovMM{pdcV}MS@ zg*XEjVj-@_sK?32LRos0v(1RVJ8j)_@t< zjIUxNeu*A>4<{ym3TG0xp~maQT;{hpjYsh!QWCq1^KdHlU5?M7ChEfsJc1=Si2T|p zAKIGR7{MSnDSi@Fi6+!m_*jH}SdE{fKbOXDG-4Q@>MDSASv!{EPJ9UmP!onI1G{6z z&Iqc19(q`Zxwsxx(Ot+cSvP7S2a)2~hndu$?XiA3*iJi(sdxdC@uG__Ij=ddqwc?n zO5_jZ*OEdUILt!z=cC3eL3Ya`?s^PUh-*XCpY6A2>5!{YTd@wcM_s6l`!O3&qV5|; zO*o2Lz^|wQ@1qh+$ueUXZ3-%Z0#rh!sO!}(Uf|PE>1y4DCRFKPK~2;zEwD zPVW*v{`=y<8sZ%;{>(XstLabXG=AMwhJhOfH9jXGY%of9T)I#DI#w)0Wq|&Ll9Cd#)Zp5|N<8rVGM7fz8Au?5{a!q zzm|?SXeh(e_&ENIjA;dAp;9lyRk#&5<7KSJ`o|J0`T%ukk7G5SM&0)dhOm`#>Ja;= zL%ADu=#P|8e;tYeIy@Y~0Nz0zx<64521*lOC?V8}BB<*z7uRDl@r$VY*PzB}!!&%; zxy`v7Rf+wj)L%DzN{1di=Nv+1{sX4qZPaV`yStvue-vF$#|kV$RjL7X|9i-;S}*FY zilbi3uTY7NVjBMB)6m3sP_M;5?uM+{iBjdG9*Ck=JRddSau+wDO5f_@w@?Y}LQT-) zJcQcPW2lu6p%U`PT|@sXwKv($GStKioKHJfq9$lW-cV~nCD4g_zRSf&QP0PnXE8{8 w9`*bsG_PgQ4^*b_Ihoxuc}{s%l^2OV5v?k#tQ;)LnUOT1G8`RTGVMg>zlea^ivR!s diff --git a/translations/he/LC_MESSAGES/messages.po b/translations/he/LC_MESSAGES/messages.po index 495366d3f..1445a68f7 100644 --- a/translations/he/LC_MESSAGES/messages.po +++ b/translations/he/LC_MESSAGES/messages.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2023-06-22 13:32+0000\n" +"POT-Creation-Date: 2023-09-14 15:58+0300\n" "PO-Revision-Date: 2020-10-16 15:42+0000\n" "Last-Translator: FULL NAME \n" "Language: he\n" @@ -16,7 +16,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" -"Generated-By: Babel 2.10.3\n" +"Generated-By: Babel 2.12.1\n" #: anyway/backend_constants.py:148 msgid "killed" @@ -30,11 +30,11 @@ msgstr "פצוע/ה קשה" msgid "light injured" msgstr "פצוע/ה קל" -#: anyway/flask_app.py:678 anyway/flask_app.py:782 +#: anyway/flask_app.py:682 anyway/flask_app.py:786 msgid "Discussion not found:" msgstr "" -#: anyway/flask_app.py:681 +#: anyway/flask_app.py:685 msgid "Illegal Discussion" msgstr "" @@ -249,12 +249,9 @@ msgstr "תאונות" #: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:109 #: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:170 -msgid "out of them" -msgstr "מתוכן" - #: anyway/widgets/road_segment_widgets/injured_count_by_severity_widget.py:121 msgid "out of them" -msgstr "מתוכם" +msgstr "מתוכן" #: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:113 #: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:172 @@ -267,7 +264,21 @@ msgid "Number of accidents by severity" msgstr "מספר תאונות לפי חומרה" #: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:123 -msgid "road_segment_namenon_urban_intersection_hebrew" +#: anyway/widgets/road_segment_widgets/accident_count_by_accident_year_widget.py:57 +#: anyway/widgets/road_segment_widgets/accident_count_by_car_type_widget.py:145 +#: anyway/widgets/road_segment_widgets/accident_count_by_hour_widget.py:31 +#: anyway/widgets/road_segment_widgets/accident_count_by_road_light_widget.py:33 +#: anyway/widgets/road_segment_widgets/accidents_heat_map_widget.py:54 +#: anyway/widgets/road_segment_widgets/injured_count_by_accident_year_widget.py:56 +#: anyway/widgets/road_segment_widgets/injured_count_by_severity_widget.py:133 +#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_stacked_widget.py:53 +#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:50 +#: anyway/widgets/road_segment_widgets/suburban_crosswalk_widget.py:73 +msgid "road_segment_name" +msgstr "" + +#: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:124 +msgid "non_urban_intersection_hebrew" msgstr "" #: anyway/widgets/all_locations_widgets/accident_count_by_severity_widget.py:129 @@ -417,19 +428,6 @@ msgstr "" msgid "Accidents in segment" msgstr "תאונות במקטע" -#: anyway/widgets/road_segment_widgets/accident_count_by_accident_year_widget.py:57 -#: anyway/widgets/road_segment_widgets/accident_count_by_car_type_widget.py:145 -#: anyway/widgets/road_segment_widgets/accident_count_by_hour_widget.py:31 -#: anyway/widgets/road_segment_widgets/accident_count_by_road_light_widget.py:33 -#: anyway/widgets/road_segment_widgets/accidents_heat_map_widget.py:54 -#: anyway/widgets/road_segment_widgets/injured_count_by_accident_year_widget.py:56 -#: anyway/widgets/road_segment_widgets/injured_count_by_severity_widget.py:133 -#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_stacked_widget.py:53 -#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:42 -#: anyway/widgets/road_segment_widgets/suburban_crosswalk_widget.py:73 -msgid "road_segment_name" -msgstr "" - #: anyway/widgets/road_segment_widgets/accident_count_by_accident_year_widget.py:63 msgid "" "Fatal, severe and light accidents count in the specified years, split by " @@ -599,7 +597,13 @@ msgstr "מספר תאונות לפי חומרה" msgid "Killed and injury stacked per age group" msgstr "חומרת פגיעה לפי קבוצת גיל" -#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:41 +#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:29 +#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget_utils.py:87 +#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget_utils.py:91 +msgid "unknown" +msgstr "לא ידוע" + +#: anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py:49 msgid "Injury per age group" msgstr "נפגעים לפי קבוצת גיל" @@ -809,3 +813,6 @@ msgstr "" #~ msgid "on street" #~ msgstr "ברחוב" +#~ msgid "road_segment_namenon_urban_intersection_hebrew" +#~ msgstr "" + From 4204550ee8364a72409e6d40307a5d1307a580ab Mon Sep 17 00:00:00 2001 From: tkalir Date: Thu, 14 Sep 2023 16:42:06 +0300 Subject: [PATCH 2/4] refactor --- .../killed_and_injured_count_per_age_group_widget.py | 2 -- .../killed_and_injured_count_per_age_group_widget_utils.py | 7 +------ 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py b/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py index c2c3bb531..8ccfffa76 100644 --- a/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py +++ b/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py @@ -10,7 +10,6 @@ from anyway.widgets.road_segment_widgets import killed_and_injured_count_per_age_group_widget_utils from anyway.widgets.road_segment_widgets.road_segment_widget import RoadSegmentWidget from anyway.widgets.widget import register -import logging @register class KilledInjuredCountPerAgeGroupWidget(RoadSegmentWidget): @@ -32,7 +31,6 @@ def generate_items(self) -> None: count_total += count structured_data_list.append({BE.LKEY: age_group, BE.VAL: count_total}) - #KilledInjuredCountPerAgeGroupWidget.prepare_data_for_ui(structured_data_list) self.items = structured_data_list diff --git a/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget_utils.py b/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget_utils.py index bff36a9b8..636022e8b 100644 --- a/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget_utils.py +++ b/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget_utils.py @@ -5,9 +5,6 @@ from flask_sqlalchemy import BaseQuery from sqlalchemy import func, asc -from flask_babel import _ -import logging - from anyway.app_and_db import db from anyway.backend_constants import BE_CONST, InjurySeverity from anyway.models import InvolvedMarkerView @@ -51,8 +48,6 @@ def filter_and_group_injured_count_per_age_group( cache_dict.popitem(last=False) cache_dict[cache_key] = dict_grouped - logging.debug("groooo") - logging.debug(dict_grouped) return dict_grouped @staticmethod @@ -84,7 +79,7 @@ def defaultdict_int_factory() -> Callable: break if not found_age_range: - dict_grouped[UNKNOWN ][injury_id] += count + dict_grouped[UNKNOWN][injury_id] += count # Rename the last key dict_grouped[SIXTY_FIVE_PLUS] = dict_grouped[SIXTY_TWOHUNDRED] del dict_grouped[SIXTY_TWOHUNDRED] From 29fcbbfd258e8de0e7845fa4ef2c384101353f77 Mon Sep 17 00:00:00 2001 From: tkalir Date: Thu, 14 Sep 2023 16:43:33 +0300 Subject: [PATCH 3/4] refactor --- .../killed_and_injured_count_per_age_group_widget.py | 1 - 1 file changed, 1 deletion(-) diff --git a/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py b/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py index 8ccfffa76..93d9f1fe3 100644 --- a/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py +++ b/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget.py @@ -33,7 +33,6 @@ def generate_items(self) -> None: structured_data_list.append({BE.LKEY: age_group, BE.VAL: count_total}) self.items = structured_data_list - @staticmethod def localize_items(request_params: RequestParams, items: Dict) -> Dict: items["data"]["text"] = { From c2561db5f5ce1b8839903b364b9f8f122728a601 Mon Sep 17 00:00:00 2001 From: tkalir Date: Thu, 14 Sep 2023 17:00:38 +0300 Subject: [PATCH 4/4] add import --- .../killed_and_injured_count_per_age_group_widget_utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget_utils.py b/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget_utils.py index 636022e8b..dcdf17088 100644 --- a/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget_utils.py +++ b/anyway/widgets/road_segment_widgets/killed_and_injured_count_per_age_group_widget_utils.py @@ -4,6 +4,7 @@ from flask_sqlalchemy import BaseQuery from sqlalchemy import func, asc +from flask_babel import _ from anyway.app_and_db import db from anyway.backend_constants import BE_CONST, InjurySeverity