When the model has defined autodelete=True, and the callback retirns True the register in the dal will not be deleted, but the files in uploads/ desapears.
# -*- coding: utf-8 -*-
def index():
return dict(message="hello from img.py")
def add():
form = SQLFORM(db.img).process()
return dict(f=form)
def grid():
grid=SQLFORM.grid(db.img, user_signature=False)
return dict(grid=grid)
# add at least 2 registers
# delete 1
# go to de grid, you will see the 2registers.
# try to see the attachment
When the model has defined
autodelete=True,
and the callback retirnsTrue
the register in the dal will not be deleted, but the files inuploads/
desapears.Model
Controller