Skip to content

Conversation

@marcinowski
Copy link
Owner

I have made things!

Hi! I'm having issues with the package resolving related managers when defining custom Managers and Querysets. This is definitely an issue with the package and to illustrate it better I added two test cases.

First case presents no issues. We're adding a custom QuerySet and plugging it into two related model in a base class using the default objects manager and the as_manager() method interface of QuerySets. It's all resolved fine and there are no errors - why this is important will be clearer with the 2nd case.

The second test case is a bit more complex in that we're tweaking the resulting manager in the as_manager. The way it's plugged into the model however doesn't change from the 1st case. Moreover, the manager itself isn't doing much, and it inherits from the default Django manager as well. The problem is that we're now getting two errors from the [django-manager-missing] check which is quite surprising.

The problem is ocurring for me in a medium sized codebase with hundreds of models managed through a shared base class and manager classes. I wouldn't say the intention is overly complex, neither is the implementation, and the fact is that Django's working perfectly fine with it and has no issues setting up the models and managers.

Related issues

Related issues & changes
typeddjango#969
typeddjango#993
typeddjango#2224

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants