Re: Make django.db.models.deletion.Collector public?

2016-07-21 Thread Romain Garrigues
Hi Shai,

I needed a similar feature in one of my projects.
I have started to use and try to extend the Django collector used in Admin 
deletion, and finished with something I was not really happy about...
I have then created a full collector (following all relations, foreign 
keys, manytomany, GFK, ...) named DeepCollector and that I released as 
django-deep-collector[1] package.
Some parameters allow you to collect some models, excludes other ones, ...
I actively maintain and use it on a daily basis in a big project (300+ 
tables) to download some production data and load it in my local 
environment.

I hope this can help!

Romain.

[1]https://github.com/iwoca/django-deep-collector

Le lundi 18 juillet 2016 15:00:59 UTC+2, Shai Berger a écrit :
>
> Hi, 
>
> We're implementing a feature where we need to access all the dependent 
> objects 
> for a given set of objects -- much like the Admin's deletion does. I note 
> that 
> we are not the first with this need, and I bring the SO question[1] as 
> evidence. As you can see in that question, it turns out that already in 
> Django, there is more than one such collector -- the one[2] used in 
> delete() 
> is not exactly suitable for use in the Admin[3]. 
>
> Shouldn't we make the collector class -- or, at least, some API to achieve 
> the 
> same goal -- public? 
>
> Shai 
>
> [1]http://stackoverflow.com/questions/12158714/ 
> [2]
> https://github.com/django/django/blob/c339a5a6/django/db/models/deletion.py#L64
>  
> [3]
> https://github.com/django/django/blob/f6681393/django/contrib/admin/utils.py#L176
>  
>

-- 
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 django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/c3cc356d-32ce-430c-a788-075233aa69b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Make django.db.models.deletion.Collector public?

2016-07-18 Thread Shai Berger
Hi,

We're implementing a feature where we need to access all the dependent objects 
for a given set of objects -- much like the Admin's deletion does. I note that 
we are not the first with this need, and I bring the SO question[1] as 
evidence. As you can see in that question, it turns out that already in 
Django, there is more than one such collector -- the one[2] used in delete() 
is not exactly suitable for use in the Admin[3].

Shouldn't we make the collector class -- or, at least, some API to achieve the 
same goal -- public?

Shai

[1]http://stackoverflow.com/questions/12158714/
[2]https://github.com/django/django/blob/c339a5a6/django/db/models/deletion.py#L64
 
[3]https://github.com/django/django/blob/f6681393/django/contrib/admin/utils.py#L176