Changes between Initial Version and Version 1 of Ticket #36155


Ignore:
Timestamp:
Jan 28, 2025, 4:49:14 PM (43 hours ago)
Author:
Vinko Mlacic
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #36155 – Description

    initial v1  
    1818}}}
    1919
     20{{{
     21Traceback (most recent call last):
     22  File "/usr/lib/python3.12/unittest/case.py", line 58, in testPartExecutor
     23    yield
     24  File "/usr/lib/python3.12/unittest/case.py", line 634, in run
     25    self._callTestMethod(testMethod)
     26  File "/usr/lib/python3.12/unittest/case.py", line 589, in _callTestMethod
     27    if method() is not None:
     28       ^^^^^^^^
     29  File "/home/vinko/projects/django/tests/annotations/tests.py", line 975, in test_complex_annotations_must_have_an_alias
     30    Book.objects.annotate(Value("title"))
     31  File "/home/vinko/projects/django/django/db/models/manager.py", line 87, in manager_method
     32    return getattr(self.get_queryset(), name)(*args, **kwargs)
     33           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     34  File "/home/vinko/projects/django/django/db/models/query.py", line 1631, in annotate
     35    return self._annotate(args, kwargs, select=True)
     36           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     37  File "/home/vinko/projects/django/django/db/models/query.py", line 1648, in _annotate
     38    if arg.default_alias in kwargs:
     39       ^^^^^^^^^^^^^^^^^
     40AttributeError: 'Value' object has no attribute 'default_alias'
     41
     42}}}
     43
    2044
    2145Similar happens with other non `Aggregate` types like: `F`, `Case` - `When`, `Subquery`, `Exists`, ...
Back to Top