#27800 closed Bug (fixed)
Crash with QuerySet.annotate(Length(...)).distinct()
| Reported by: | Lex Berezhny | Owned by: | nobody |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | 1.11 |
| Severity: | Release blocker | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
After 3b2db6ec12ce7d4b32f60dd7713e5f23cac498b7, this query for test/annotations/ crashes with AttributeError: 'IntegerField' object has no attribute 'model'.
Employee.objects.annotate(
name_len=Length('first_name'),
).distinct('name_len').values_list('name_len', flat=True)
Note:
See TracTickets
for help on using tickets.
In ac5f886c: