@listens_for(Image, 'after_delete')
def del_image(mapper, connection, target):
    if target.path:
        # Delete image
        try:
            os.remove(op.join(file_path, target.path))
        except OSError:
            pass

        # Delete thumbnail
        try:
            os.remove(op.join(file_path,
                              form.thumbgen_filename(target.path)))
        except __HOLE__:
            pass


# Administrative views
dataset/ETHPy150Open flask-admin/flask-admin/examples/forms/app.py/del_image