Tuesday, September 27, 2011

Re: queryset.delete() ON DELETE ...

On Tue, Sep 27, 2011 at 8:30 AM, Thomas Guettler <hv@tbz-pariv.de> wrote:
> it seems, that the django ORM can only do deletes which result in a lot
> of SQL-Queries to do "on delete cascade" in python code.
>
> https://docs.djangoproject.com/en/1.3/ref/models/querysets/#delete
>
> Is there a way to leave this up to the database?

I believe you're looking for `on_delete=DO_NOTHING` -- see
https://docs.djangoproject.com/en/1.3/ref/models/fields/#django.db.models.ForeignKey.on_delete.
This'll leave any cascading (or whatever) up to the database.

Jacob

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

No comments:

Post a Comment