Annotating with Chr raises ValueError
>>> Author.objects.annotate(first_letter=Chr(Value(77)))
File "/Users/.../.../.venv/lib/python3.9/site-packages/django/db/models/expressions.py", line 369, in <lambda>
else int(value)
ValueError: invalid literal for int() with base 10: 'M'
I'm suggesting in Chr we can set output_field = CharField() to prevent this.
Change History
(5)
| Description: |
modified (diff)
|
| Triage Stage: |
Unreviewed → Accepted
|
| Triage Stage: |
Accepted → Ready for checkin
|
| Resolution: |
→ fixed
|
| Status: |
assigned → closed
|
PR