I believe the reason is efficiency. If there were an on_delete
argument for GFKs every object deletion of any class would need to do
a query to check if there happens to be any GFK related objects. In
addition, Django can't guarantee foreign key consistency. In case of
concurrent transactions it is possible an insert could be made which
is not visible to the deletion code.

 - Anssi

On Mar 7, 3:50 pm, Marc Aymerich <glicer...@gmail.com> wrote:
> The django docs says:
> Unlike ForeignKey, GenericForeignKey does not accept an on_delete
> argument to customize this behavior; if desired, you can avoid the
> cascade-deletion simply by not using GenericRelation, and alternate
> behavior can be provided via the pre_delete signal.
>
> Does anyone knows why? I mean, is it for some conceptual/technical
> reason that makes it impractical to implement or is it because nobody
> put efforts to make it happen? Or maybe GFK are not so well integrated
> with the ORM and as soon as they become integrated, then this feature
> will come for free?
>
> Thanks!
> --
> Marc

-- 
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+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to