def delete(id): photo = Photo.get(id) if photo is None: abort(404) url = photos.url(photo.filename) # try to delete the record and remove it from directory return redirect(url_for('index'))
def url(self): return(photos.url(self.filename))