From 8e336e12941192ecadbebc7815e9f826522222c5 Mon Sep 17 00:00:00 2001 From: Avi Date: Thu, 28 Dec 2017 00:01:47 +0200 Subject: [PATCH] Hiding the bikes accidents in case the server restart won't fix the problem. --- anyway/models.py | 20 ++++++++++---------- templates/index.html | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/anyway/models.py b/anyway/models.py index ef0aa1981..ed85ab3b4 100755 --- a/anyway/models.py +++ b/anyway/models.py @@ -334,16 +334,16 @@ def bounding_box_query(is_thin=False, yield_per=None, involved_and_vehicles=Fals if kwargs.get('acctype', 0) != 0: if kwargs['acctype'] <= 20: markers = markers.filter(AccidentMarker.subtype == kwargs['acctype']) - elif kwargs['acctype'] == CONST.BIKE_ACCIDENTS_NO_CASUALTIES: - markers = markers.filter(and_(AccidentMarker.vehicles.any(), AccidentMarker.involved.any())).\ - filter(AccidentMarker.vehicles.any(Vehicle.vehicle_type == CONST.VEHICLE_TYPE_BIKE)).group_by(AccidentMarker.id).\ - having(~AccidentMarker.involved.\ - any(Involved.involved_type != CONST.INVOLVED_TYPE_DRIVER_UNHARMED)) - elif kwargs['acctype'] == CONST.BIKE_ACCIDENTS_WITH_CASUALTIES: - markers = markers.filter(and_(AccidentMarker.vehicles.any(), AccidentMarker.involved.any())).\ - filter(AccidentMarker.vehicles.\ - any(Vehicle.vehicle_type == CONST.VEHICLE_TYPE_BIKE)).group_by(AccidentMarker.id).\ - having(AccidentMarker.involved.any(Involved.involved_type != CONST.INVOLVED_TYPE_DRIVER_UNHARMED)) + # elif kwargs['acctype'] == CONST.BIKE_ACCIDENTS_NO_CASUALTIES: + # markers = markers.filter(and_(AccidentMarker.vehicles.any(), AccidentMarker.involved.any())).\ + # filter(AccidentMarker.vehicles.any(Vehicle.vehicle_type == CONST.VEHICLE_TYPE_BIKE)).group_by(AccidentMarker.id).\ + # having(~AccidentMarker.involved.\ + # any(Involved.involved_type != CONST.INVOLVED_TYPE_DRIVER_UNHARMED)) + # elif kwargs['acctype'] == CONST.BIKE_ACCIDENTS_WITH_CASUALTIES: + # markers = markers.filter(and_(AccidentMarker.vehicles.any(), AccidentMarker.involved.any())).\ + # filter(AccidentMarker.vehicles.\ + # any(Vehicle.vehicle_type == CONST.VEHICLE_TYPE_BIKE)).group_by(AccidentMarker.id).\ + # having(AccidentMarker.involved.any(Involved.involved_type != CONST.INVOLVED_TYPE_DRIVER_UNHARMED)) if kwargs.get('controlmeasure', 0) != 0: markers = markers.filter(AccidentMarker.road_control == kwargs['controlmeasure']) if kwargs.get('district', 0) != 0: diff --git a/templates/index.html b/templates/index.html index 77ea9fc88..06315d7f0 100644 --- a/templates/index.html +++ b/templates/index.html @@ -886,10 +886,10 @@ - +
גילאי מעורכים