#36892: Lazy Tuples in field Choices generate repeated migrations with no
changes
-------------------------------------+-------------------------------------
Reporter: Matt Armand | Owner: Ahmed
| Shammas J
Type: Bug | Status: assigned
Component: Migrations | Version: 5.0
Severity: Normal | Resolution:
Keywords: migrations tuple | Triage Stage: Accepted
choices lazy functional |
deconstruction |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):
* has_patch: 1 => 0
* keywords: migrations tuple choices lazy functional => migrations tuple
choices lazy functional deconstruction
* stage: Unreviewed => Accepted
Comment:
Thanks for the report. The specific location you're seeing this problem
inside `choices` is new since 500e01073adda32d5149624ee9a5cb7aa3d3583f,
but the problem applies to all field arguments, as discussed in
ticket:29852#comment:6 where a proposed solution is identified:
> Promise serialization currently assumes it's only used for string values
and it should be adjusted to deal with other types as well. What I suggest
doing is inspecting wrapped types of the promise object and only perform a
str on the value if the types are (str,). Else the value should be
deconstructed as a django.utils.functional.lazy import and a lazy(...)()
reconstruction.
--
Ticket URL: <https://code.djangoproject.com/ticket/36892#comment:3>
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 visit
https://groups.google.com/d/msgid/django-updates/0107019c0f431d30-65591ec4-058f-4d1f-8f10-becc0196e2ab-000000%40eu-central-1.amazonses.com.