-
-
Notifications
You must be signed in to change notification settings - Fork 624
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 2.0 and tags__name__in=[""] error #511
Comments
I was unable to reproduce. Could you provide more details about your minimal example or write a failing test for the taggit test suite? |
Sorry for my bad english language.I attach a short description of the problem in .pdf |
models.py
api_views.py
Mon, 18 Dec 2017 01:02:18 +0300 python@3.6.1 django@2.0 it works fine with django@1.11 |
same error here with django 2.0 |
Can you confirm you've included the changes from #509? The error suggests to me that is is missing. |
oh you're right , i used pip install django-taggit today, but my version doesn't have the changes from #509 |
Thanks for testing. |
In Django 2.0, filtering using tags__name__in doesen't work.
When try to use this function for example:
published= Post.published.all() and then
published.filter(tags__name__in=['music'])
I have this:
Traceback (most recent call last):
File "/home/prorok/Django/Django/lib/python3.6/site-packages/django/core/handlers/exception.py", line 35, in inner
response = get_response(request)
File "/home/prorok/Django/Django/lib/python3.6/site-packages/django/core/handlers/base.py", line 128, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/home/prorok/Django/Django/lib/python3.6/site-packages/django/core/handlers/base.py", line 126, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/prorok/Django/mysite/blog/views.py", line 95, in post_detail
similar_posts = Post.published.filter(tags__in=post_tags_ids).exclude(id=post.id)
File "/home/prorok/Django/Django/lib/python3.6/site-packages/django/db/models/manager.py", line 82, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/prorok/Django/Django/lib/python3.6/site-packages/django/db/models/query.py", line 836, in filter
return self._filter_or_exclude(False, *args, **kwargs)
File "/home/prorok/Django/Django/lib/python3.6/site-packages/django/db/models/query.py", line 854, in _filter_or_exclude
clone.query.add_q(Q(*args, **kwargs))
File "/home/prorok/Django/Django/lib/python3.6/site-packages/django/db/models/sql/query.py", line 1252, in add_q
clause, _ = self._add_q(q_object, self.used_aliases)
File "/home/prorok/Django/Django/lib/python3.6/site-packages/django/db/models/sql/query.py", line 1276, in _add_q
split_subq=split_subq,
File "/home/prorok/Django/Django/lib/python3.6/site-packages/django/db/models/sql/query.py", line 1152, in build_filter
lookups, parts, reffed_expression = self.solve_lookup_type(arg)
File "/home/prorok/Django/Django/lib/python3.6/site-packages/django/db/models/sql/query.py", line 1015, in solve_lookup_type
_, field, _, lookup_parts = self.names_to_path(lookup_splitted, self.get_meta())
File "/home/prorok/Django/Django/lib/python3.6/site-packages/django/db/models/sql/query.py", line 1390, in names_to_path
pathinfos = field.get_path_info(filtered_relation)
TypeError: get_path_info() takes 1 positional argument but 2 were given
I used #509.
The text was updated successfully, but these errors were encountered: