On Tue, Mar 23, 2010 at 10:21 PM, jrs <j...@framemedia.com> wrote: > > > On Mar 23, 10:05 am, "ge...@aquarianhouse.com" > <ge...@aquarianhouse.com> wrote: >> Filter would be better :) >> >> Container.objects.filter( >> pk=container_id >> ).delete() > > Why is filter better here, since it's a one record delete?
It isn't. > Also, am I correct is believing that this creates a painfully easy way > to bring down the house with a trivial delete? Hyperbole aside, if an object that is selected for deletion has a long chain of dependent objects, then yes, you may experience performance problems. Solution - plan your code so that long-chain deletes aren't put somewhere that a web request could activate them. However, as I said, Django's default behavior is to ensure consistency in your database. This behavior is clearly documented [1], and we are investigating ways of customizing this behavior [2]. [1] http://docs.djangoproject.com/en/dev/topics/db/queries/#deleting-objects [2] http://code.djangoproject.com/ticket/7539 Yours, Russ Magee %-) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.