I have a statement---

    Container.objects.get(
         pk=container_id
    ).delete()

This seemingly trivial operation hammers the db with 581 queries!!
The reason being that the django orm has decided that it will enforce
referential integrity as a default behavior.  As you could imagine,
this seemingly trivial operation could bring down a site in no time.
I guess the answer is to override the models delete() method.  If this
is the case, why is CASCADE not used as an optional attribute by
django?  Why is it the default?  Aren't we looking at an obvious way
for a developer to bring down the house with a seemingly simple 1
record delete?

Thanks.

-- 
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.

Reply via email to