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

Related Field got invalid lookup: icontains #185

Open
harsha09 opened this issue Jan 25, 2023 · 0 comments
Open

Related Field got invalid lookup: icontains #185

harsha09 opened this issue Jan 25, 2023 · 0 comments

Comments

@harsha09
Copy link

This is occurring when I tried searching in Django admin for Revisions. This is due to https://github.com/jedie/django-reversion-compare/blob/master/reversion_compare/admin.py#L271, as the user field is a FK to the User table. The search fields should refer to the exact field in the table instead of a FK.

For example: user__name or user__email.

Request Method: | GET
-- | --
http://localhost:8000/myapp/reversion/revision/?q=sdfs
3.2.16
FieldError
Related Field got invalid lookup: icontains
/Users//.venv/lib/python3.10/site-packages/django/db/models/sql/query.py, line 1207, in build_lookup
/Users//.venv/bin/python
3.10.5

Django version: 3.2.16
django-reversion: 5.0.4
django-reversion-compare: 0.15.0

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