On Dec 21, 11:07 pm, Thadeus Burgess <thade...@thadeusb.com> wrote: > dope...
What!?! You mean this wasn't intuitively _obvious_? (ha! It sure isn't to me, and I wouldn't expect anyone else - although once this has bitten you a time or two, it becomes memorable....) No, no dope at all.... There are a lot of fields for the Field() constructor, and this is a sort of extra-sql "ondelete" one ... would it be "more intuitive" (?) if it were just a special, extra-sql behavior, an extension of 'ondelete'? ... You (everyone) probably wants to get familiar with the section, starting on P.154 of the 2009/v2 manual on the Field() constructor, and it's defaults. Curiously, it is under section 6.4, titled "Migrations" (which is probably just a mistake; there could have been an additional section/name): • autodelete - determines if the corresponding uploaded file should be deleted when the record referencing the file is deleted. For "upload" fields only. - Yarko > > http://markmail.org/message/vdyy5j5fclv2vgnh#query:web2py%20delete%20... > > :) > > [SOLVED] > > -Thadeus > > On Mon, Dec 21, 2009 at 10:57 PM, Thadeus Burgess > <thade...@thadeusb.com>wrote: > > > > > If I am deleting an upload field from my database, how do I also seamlessly > > remove its corresponding file? > > > Currently I have a query as such. Would I need to perform a select query > > first, looping through the filenames and using os.unlink to delete these > > files, and then remove the record from the database? > > > db(my_super_awesome_cleaning_query).delete() > > > -Thadeus -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.