Marcin Nowak <> skrev: (14 oktober 2016 15:08:15 CEST)
>Hi all.
>Sometimes there is huge amount of related objects. In the effect there
>no possibility to delete a model because of http timeout error.
>Displaying objects to be deleted is quite nice feature, but just
>in cases like that. 
>Another thing is that nobody will read 74k related objects. Believe me.
>is better to display a summary in that case. 
>To display the summary, a related objects must be counted and this is
>consuming process, of course, but we can count them similar way to 
>Collector's fast deletion (using querysets instead of counting models
>by one).
>There is also other design flaw in ModelAdmin.delete_view() - related 
>objects are counted twice: one time for display, and second time after 
>confirming deletion (for request.method==POST). For the second case
>is checking only permissions and collected objects aren't used for
>else. Until Django provides no row-level permissions checking those can
>done without instantiating all related objects again.

Even though Django doesn't include an implementation of object-level 
permissions, it does expose a public API for third-party packages to implement 
them. It probably wouldn't be appropriate to break those, but it might be 
feasible to make it possible to opt into the fast path explicitly. 

>I'd like to suggest:
>   - separation of permissions checking from related objects collector,
>   - adding configration option for ModelAdmin.delete_view (to display 
>   related objects, display summary, or finally display nothing).
>Thank you.

You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To post to this group, send email to
Visit this group at
To view this discussion on the web visit
For more options, visit

Reply via email to