I just figured that would be default behavior... why would I have a file on
my system with absolutely no references to them anymore? And no "easy" way
to get those references back? (except from backups, but uploads probably
would go into the archive with the database)

Would it be more intuitive... I don't think so. You would still need to know
that the option was available, what it did, and alas, still need the
documentation on the matter (flipping through paper back sucks, pdf search
isn't contextual). Dealing with a framework, there are tons of variables and
options, I have been working with it for a couple months now, and there are
still little things about it I am learning every day, especially when I dive
into the source code. Like you said, it only takes one or two bites before
it gets memorized, so no matter what the name, I probably still would not
have known to set it explicitly (that is unless the book/examples/AlterEgo
talked about upload fields it made a reference about this specific matter...
that would help)

I read the manual more like a bible instead of a book. Use it for the few
sections I need at that moment, and not a line further. Perhaps I should
read the whole thing start to finish, but thats what I say about the bible
too, and it never happens *grins*

-Thadeus




On Mon, Dec 21, 2009 at 11:31 PM, Yarko Tymciurak <
resultsinsoftw...@gmail.com> wrote:

> 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<web2py%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/web2py?hl=en.
>
>
>

--

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.


Reply via email to