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: permissions and groups data migration

2014-12-31 Thread Aymeric Augustin
Hi Adam, Migrations build a fake app registry containing fake app configs for each state of the models. They implement a small subset of features of the real app configs. See https://github.com/django/django/blob/5e32605/django/db/migrations/state.py#L119-L131 That’s why my_app_config.models_

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