def _image_locations_delete_all(context, image_id, delete_time=None, session=None):
 session = (session or get_session())
 location_refs = session.query(models.ImageLocation).filter_by(image_id=image_id).filter_by(deleted=False).all()
 for loc_id in [loc_ref.id for loc_ref in location_refs]:
  image_location_delete(context, image_id, loc_id, 'deleted', delete_time=delete_time, session=session)

def _image_locations_delete_all ( context , image_id , delete_time = None , session = None ) : session = ( session or get_session ( ) ) location_refs = session . query ( models . ImageLocation ) . filter_by ( image_id = image_id ) . filter_by ( deleted = False ) . all ( ) for loc_id in [ loc_ref . id for loc_ref in location_refs ] : image_location_delete ( context , image_id , loc_id , 'deleted' , delete_time = delete_time , session = session )
delete all image locations for given image .