Yeah, that’s a good point Michal. On Sat, Aug 27, 2016 at 1:14 PM Michal Petrucha < [email protected]> wrote:
> On August 27, 2016 5:48:26 PM GMT+02:00, Paulo Gabriel Poiati < > [email protected]> wrote: > >Hello Aymeric, > > > >I think you are probably right, including it in Django itself will > >only benefit big projects. I mean, changing all the existing models > >to receive the DefaultManager is a burden depending on the project > >size. But we can overcome this by applying the “never extend > >models.Model directly” pattern. > > Another argument against this feature would be that most Django > projects use a collection of third-party packages, or at least some > from django.contrib. Globally changing all models' default managers > wouldn't only affect your code, but also every package that's not > under your control. As long as you'd only add some logging, that might > be OK, but changing behavior in any way (like adding a default filter, > or changing the behavior of create, as you suggested in the original > post) would likely break those third-party packages with a lot of > potential for hard to find obscure issues. Unless, of course, you > explicitly whitelist only your models in that custom manager, and fall > back to the default behavior in other models, but that would rather > beat the purpose of this feature. > > For customizations like this you're definitely better off opting in > with every single model (using your own base class) than changing all > models globally. > > Cheers, > > Michal > > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > 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/20160827161409.GB6601%40koniiiik.org > . > For more options, visit https://groups.google.com/d/optout. > -- *[]'s* *Paulo Poiati* blog.paulopoiati.com -- 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 [email protected]. To post to this group, send email to [email protected]. 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/CABqSV%3DJrq-uVznJVGvgnwXdv9zxM_5r%2BVbfwJND8rFvDoKN0_w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
