Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhers committed Dec 29, 2017
2 parents efe60ad + 8e336e1 commit 7a1cba9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions anyway/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -886,10 +886,10 @@ <h4 class="modal-title">העדפות:</h4>
<label for="checkbox-type-pedestrian" class="btn one">אחר</label>
<input type="radio" name="acctype" id="checkbox-type-else" value=1 onclick="app.loadFilter()" />
<label for="checkbox-type-else" class="btn one">פגיעה בהולך רגל</label>
<input type="radio" name="acctype" id="checkbox-type-bike-no-casualties" value=21 onclick="app.loadFilter()" />
<!--<input type="radio" name="acctype" id="checkbox-type-bike-no-casualties" value=21 onclick="app.loadFilter()" />
<label for="checkbox-type-bike-no-casualties" class="btn one">אופניים ללא נפגעים</label>
<input type="radio" name="acctype" id="checkbox-type-bike-with-casualties" value=22 onclick="app.loadFilter()" />
<label for="checkbox-type-bike-with-casualties" class="btn one">אופניים עם נפגעים</label>
<label for="checkbox-type-bike-with-casualties" class="btn one">אופניים עם נפגעים</label>-->
</div>

<div class="btn-label">גילאי מעורכים</div>
Expand Down

0 comments on commit 7a1cba9

Please sign in to comment.