You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using a combined filter, in one of the expressions of which negation is used, the exception appears:
Traceback (most recent call last):
File "C:\Users\Roman\AppData\Local\Programs\PyCharm Professional\plugins\python\helpers\pydev\pydevconsole.py", line 364, in runcode
coro = func()
^^^^^^
File "<input>", line 1, in <module>
File "C:\Users\Roman\PycharmProjects\tugan-mono\projects\server\venv\Lib\site-packages\django\db\models\manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Roman\PycharmProjects\tugan-mono\projects\server\venv\Lib\site-packages\eav\queryset.py", line 175, in wrapper
arg = rewrite_q_expr(self.model, arg)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Roman\PycharmProjects\tugan-mono\projects\server\venv\Lib\site-packages\eav\queryset.py", line 107, in rewrite_q_expr
rewritable = [c for c in expr.children if is_eav_and_leaf(c, gr_name)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Roman\PycharmProjects\tugan-mono\projects\server\venv\Lib\site-packages\eav\queryset.py", line 107, in <listcomp>
rewritable = [c for c in expr.children if is_eav_and_leaf(c, gr_name)]
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Roman\PycharmProjects\tugan-mono\projects\server\venv\Lib\site-packages\eav\queryset.py", line 48, in is_eav_and_leaf
and expr.children[0][0] in ['pk__in', '{}__in'.format(gr_name)]
~~~~~~~~~~~~~~~~^^^
TypeError: 'Q' object is not subscriptable
The model code is quite large, because there is inheritance. But if it is needed, I will send it.
In the project, I got around this bug by using the exclude method for expressions with negation, but it isn't solution.
Steps to Reproduce
Just filter some EavQuerySet with more than 1 expression, one of which is negated.
Your Environment
Include relevant details about the environment you experienced the bug in.
Version used: 1.6.1
Environment name and version (e.g. Django 2.0.4, pip 9.0.1): Django 3.2.9
Operating System and version: Windows / Ubuntu
The text was updated successfully, but these errors were encountered:
Using a combined filter, in one of the expressions of which negation is used, the exception appears:
Expression that called exception:
The model code is quite large, because there is inheritance. But if it is needed, I will send it.
In the project, I got around this bug by using the exclude method for expressions with negation, but it isn't solution.
Steps to Reproduce
Just filter some EavQuerySet with more than 1 expression, one of which is negated.
Your Environment
Include relevant details about the environment you experienced the bug in.
The text was updated successfully, but these errors were encountered: