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

usage of django_filters.filters.OrderingFilter raises a Warning #263

Closed
ticosax opened this issue Jan 18, 2021 · 3 comments
Closed

usage of django_filters.filters.OrderingFilter raises a Warning #263

ticosax opened this issue Jan 18, 2021 · 3 comments
Labels
bug Something isn't working fix confirmation pending issue has been fixed and confirmation from issue reporter is pending

Comments

@ticosax
Copy link
Contributor

ticosax commented Jan 18, 2021

Describe the bug

Usage of django_filters.filters.OrderingFilter warns.

To Reproduce

For given filterset definition.

class BaseModelFilterSet(FilterSet):
    o = filters.OrderingFilter(fields=(('id', 'id'),), field_labels={'id': 'ID'}))
python manage.py spectacular --fail-or-warn

exit with code 1

Warning #11: could not resolve field on model <class 'xxxx.xxxx.XxxxxXxx'> with path "o". this is likely a custom field that does some unknown magic. maybe consider annotating the field/property? defaulting to "string". (Exception: XxxxxXxx has no field named 'o')

Expected behavior
django_filters.filters.OrderingFilter usage shouldn't warn.

@tfranzel
Copy link
Owner

i see... that library is a rabbit hole 😄, the fix is easy though. i'll try and see if there are more cases missing.

@tfranzel tfranzel added the bug Something isn't working label Jan 21, 2021
@tfranzel tfranzel added the fix confirmation pending issue has been fixed and confirmation from issue reporter is pending label Jan 21, 2021
@ticosax
Copy link
Contributor Author

ticosax commented Jan 22, 2021

I confirm it is Fixed ! 🎉
Thanks a lot, that's a great library you made here.

@ticosax ticosax closed this as completed Jan 22, 2021
@tfranzel
Copy link
Owner

awesome. thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fix confirmation pending issue has been fixed and confirmation from issue reporter is pending
Projects
None yet
Development

No branches or pull requests

2 participants