-
-
Notifications
You must be signed in to change notification settings - Fork 622
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
get_extra_restriction()
missing required positional argument related_alias
#776
Comments
get_extra_restriction()
missing required positional argument related_alias
We don't have support for Django 4.0 just yet (it's not even being tested in CI), but according to the release notes of Django 4.0 the signature for So yeah, this is something that will likely get fixed with Django 4.0 support |
I'm experiencing the same issue. Please let us know if anyone finds any workarounds for this issue in the meantime. |
It *should* probably all work once django-taggit releases a version that supports Django 4.0 and python 3.10. See jazzband/django-taggit#776 For #223
- add a shim around `get_extra_restriction` so that it works in versions of Django >=4 and <4 - fixes jazzband#776
Using Django-Taggit on Django 4.0rc1 (running on Python 3.9). I have a model called TransactionJournal that contains following line:
tags = TaggableManager(blank=True)
Querying the model with the following statement results in the below error:
TransactionJournal.objects.filter(tags__name__in=["t1", "t2"])
Traceback (most recent call last): File "<console>", line 1, in <module> File "/Users/XXX/.local/share/virtualenvs/YYY-rEzd9bfd/lib/python3.9/site-packages/django/db/models/query.py", line 256, in __repr__ data = list(self[:REPR_OUTPUT_SIZE + 1]) File "/Users/XXX/.local/share/virtualenvs/YYY-rEzd9bfd/lib/python3.9/site-packages/django/db/models/query.py", line 280, in __iter__ self._fetch_all() File "/Users/XXX/.local/share/virtualenvs/YYY-rEzd9bfd/lib/python3.9/site-packages/django/db/models/query.py", line 1354, in _fetch_all self._result_cache = list(self._iterable_class(self)) File "/Users/XXX/.local/share/virtualenvs/YYY-rEzd9bfd/lib/python3.9/site-packages/django/db/models/query.py", line 51, in __iter__ results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size) File "/Users/XXX/.local/share/virtualenvs/YYY-rEzd9bfd/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1189, in execute_sql sql, params = self.as_sql() File "/Users/XXX/.local/share/virtualenvs/YYY-rEzd9bfd/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 545, in as_sql from_, f_params = self.get_from_clause() File "/Users/XXX/.local/share/virtualenvs/YYY-rEzd9bfd/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 833, in get_from_clause clause_sql, clause_params = self.compile(from_clause) File "/Users/XXX/.local/share/virtualenvs/YYY-rEzd9bfd/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 463, in compile sql, params = node.as_sql(self, self.connection) File "/Users/XXX/.local/share/virtualenvs/YYY-rEzd9bfd/lib/python3.9/site-packages/django/db/models/sql/datastructures.py", line 81, in as_sql extra_cond = self.join_field.get_extra_restriction(self.table_alias, self.parent_alias) File "/Users/XXX/.local/share/virtualenvs/YYY-rEzd9bfd/lib/python3.9/site-packages/django/db/models/fields/reverse_related.py", line 168, in get_extra_restriction return self.field.get_extra_restriction(related_alias, alias) TypeError: get_extra_restriction() missing 1 required positional argument: 'related_alias'
Any thoughts on what might be causing this?
The text was updated successfully, but these errors were encountered: