#34480: Annotating with Chr raises ValueError
-------------------------------------+-------------------------------------
Reporter: Jacob | Owner: Jacob Walls
Walls |
Type: Bug | Status: assigned
Component: Database | Version: 4.2
layer (models, ORM) |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
{{{
>>> Author.objects.annotate(first_letter=Chr(Value(77)))
File "/Users/.../geoguard/.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.
--
Ticket URL: <https://code.djangoproject.com/ticket/34480>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/010701876bc0f293-d70ca8d3-0649-495a-8b4e-803eb40b405c-000000%40eu-central-1.amazonses.com.