#24157: Prompt to add a new field after renaming
----------------------------+--------------------------------------
Reporter: basilu | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
----------------------------+--------------------------------------
Changes (by charettes):
* cc: charettes (added)
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
The rename detection works by comparing removed and added fields and
searching for deconstructed `args` and `kwargs` equality. It has no
notion of `name` similarity.
In your case, since the field `name` and its `verbose_name` are changed at
the same time the autodetector fails to prompt you for a possible rename.
I'm afraid this cannot be solved easily without some kind of heuristics to
detect `name` similarity and a whitelist of specific `args` or `kwargs`
allowed to be changed during a rename.
I think we should close this ticket as ''Wont Fix'' or document the
limitations of the actual implementation. Users are still allowed to
manually replace the generated `AddField` and `RemoveField` with a
`RenameField` operation.
--
Ticket URL: <https://code.djangoproject.com/ticket/24157#comment:1>
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 post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.8ed205fcc6b916be55bb7edfbd7927f6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.