Re: QuerySet.as_manager doesn't offer a way to use_for_related_fields

2014-12-31 Thread Martin Chase
Hey Marcus, Thanks for the ideas. I haven't tested it, but the second solution is specifically mentioned as not working in the docs: https://docs.djangoproject.com/en/1.7/topics/db/managers/#set-use-for-related-fields-when-you-define-the-class Your first solution is what I have in place now (spe

Re: QuerySet.as_manager doesn't offer a way to use_for_related_fields

2014-12-31 Thread Markus Holtermann
Hey Martin, To solve the problem I can think of two reasonable solutions: class MyManager(models.Manager.from_queryset(MyQuerySet)): use_for_related_fields = True or class MyModel(models.Model): objects = MyQuerySet.as_manager() objects.use_for_related_fields = True After all, as_m

QuerySet.as_manager doesn't offer a way to use_for_related_fields

2014-12-30 Thread Martin Chase
Hey all, I make extensive use of managers, and I was excited to start using as_manager for my queryset/manager mashups, but it seems use_for_related_fields isn't a part of as_manager's considerations. I can think of two sensible implementations: pass an argument to as_manager(), or honor a cla