Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Field cannot be both deferred and traversed using select_related at the same time. #27

Open
muhhshoaib opened this issue Oct 19, 2017 · 0 comments

Comments

@muhhshoaib
Copy link

muhhshoaib commented Oct 19, 2017

When running the makemessages command and the model has the customModelManager Defined, it's giving an error message saying Field cannot be both deferred and traversed using select_related at the same time. I checked the code and it calls the .only method on the ModelManager. I looked at the django documentation for the .only method (Using only() and omitting a field requested using select_related() is an error as well and found out it fails with the select_related method.
This is what the docs says

Using only() and omitting a field requested using select_related() is an error as well.

This is my customer ModelManager Looks like.

class CustomManager(models.Manager):

    def get_queryset(self):
        return CustomManager(self.model).select_related('field')
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

No branches or pull requests

1 participant