On further trace, it looks like Question 1 is a bug ... in my code (I
sort of expected that). Sorry for making a noise. However, question2
still stands.

On Feb 29, 3:19 pm, weheh <[email protected]> wrote:
> db.define_table('test',
>
> Field('test_id',db.referrer,requires=IS_NULL_OR(IS_IN_DB(db,'referrer.id')) ),
>     Field('name','upload',label=T('Upload file'),
>         autodelete=True,
>         uploadfolder=os.path.join(request.folder,'static/data'),
>         uploadseparate=True,
>         requires=(
>             IS_UPLOAD_FILENAME(extension='txt'),
>             IS_LENGTH(5000000,10))
>         ),
>     Field('image','upload',label=T('Image'),
>         autodelete=True,
>         uploadseparate=True,
>         requires=(IS_NOT_EMPTY(),IS_IMAGE(),IS_LENGTH(128000,10))),
>     )
>
> Question 1: **this may be a bug.**
> When I delete a "test" record, the image is not being deleted. Isn't
> autodelete=True supposed to do that for me? I know I have seen this
> work before, but it's not working for me now. v 1.99.4. I am in the
> process of tracing this more thoroughly.
>
> Question 2:
> How do I selectively delete the "image" field without deleting the
> entire "test" record? In other words, I want to delete the image file
> and null-out the image field, but leave the rest of the test record
> intact.

Reply via email to