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

django_filters is not compatible #881

Open
Jorgeamayapabon opened this issue Dec 20, 2023 · 1 comment
Open

django_filters is not compatible #881

Jorgeamayapabon opened this issue Dec 20, 2023 · 1 comment

Comments

@Jorgeamayapabon
Copy link

Hello, I am developing a project where I am using django_filters and there are some views where I have filters and apparently I have problems because of that. This is the message "UserWarning: <class 'apps.tenant_apps.product.api.views.ProductByCategoriesListView'> is not compatible with schema generation" and comes from django filters. I am following the documentation to the letter but I see no support for this warning. What should I do ?

@Mubarisk
Copy link

Mubarisk commented Nov 20, 2024

def get_queryset(self):
    if self.request.user.is_anonymous:
         return Model.objects.none()
    return {actual queryset}

the schema generation failed because the schema didn't get the attributes from the qs
this is work for me,
if you found anything better please share

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

2 participants