Changes between Initial Version and Version 1 of Ticket #36352
- Timestamp:
- Apr 25, 2025, 7:46:22 AM (4 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #36352 – Description
initial v1 26 26 django.core.exceptions.FieldError: Cannot select the 'created' alias. Use annotate() to promote it. 27 27 }}} 28 29 Current workaround is to include the annotated field in .values like so 30 31 {{{ 32 >>> c = b.filter(id=OuterRef('id')).values('schema', 'created') 33 >>> d = Tenant.objects.values('schema_name').annotate(created_at=Subquery(c.values('created')[:1])) 34 >>> d[:1] 35 <QuerySet [{'schema_name': 'sample', 'created_at': datetime.date(2024, 11, 4)}]> 36 }}}