diff --git a/anyway/models.py b/anyway/models.py index a33be5818..ef0aa1981 100755 --- a/anyway/models.py +++ b/anyway/models.py @@ -5,7 +5,7 @@ from .constants import CONST from collections import namedtuple from sqlalchemy import Column, Integer, String, Boolean, Float, ForeignKey, DateTime, Text, Index, desc, sql, Table, \ - ForeignKeyConstraint, func + ForeignKeyConstraint, func, and_ from sqlalchemy.orm import relationship, load_only, backref from .utilities import init_flask, decode_hebrew from flask.ext.sqlalchemy import SQLAlchemy @@ -335,12 +335,12 @@ def bounding_box_query(is_thin=False, yield_per=None, involved_and_vehicles=Fals if kwargs['acctype'] <= 20: markers = markers.filter(AccidentMarker.subtype == kwargs['acctype']) elif kwargs['acctype'] == CONST.BIKE_ACCIDENTS_NO_CASUALTIES: - markers = markers.\ + 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. \ + 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)) diff --git a/static/css/style.css b/static/css/style.css index 8070f6285..a45076ff6 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -765,7 +765,7 @@ input[type='checkbox']{ #filter-string{ text-align: center; vertical-align: middle; - padding-top: 10%; !important; + padding-top: 4% !important; } #filter-string > p{