Re: [Django] #24157: Prompt to add a new field after renaming

2020-11-28 Thread Django
#24157: Prompt to add a new field after renaming
-+-
 Reporter:  Basil Upornikov  |Owner:  nobody
 Type:   |   Status:  closed
  Cleanup/optimization   |
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:  duplicate
 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 Mariusz Felisiak):

 * status:  new => closed
 * resolution:   => duplicate
 * stage:  Someday/Maybe => Unreviewed


Comment:

 Duplicate of #32206, which was closed as a duplicate of #31700.

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.cb65f9595c2925e3a463733806a09bbf%40djangoproject.com.


Re: [Django] #24157: Prompt to add a new field after renaming

2015-01-15 Thread Django
#24157: Prompt to add a new field after renaming
-+-
 Reporter:  basilu   |Owner:  nobody
 Type:   |   Status:  new
  Cleanup/optimization   |
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
 |  Someday/Maybe
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by charettes):

 * type:  Bug => Cleanup/optimization
 * stage:  Unreviewed => Someday/Maybe


--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.c010b37c9aaa9410135549ecdae1069b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24157: Prompt to add a new field after renaming

2015-01-15 Thread Django
#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: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
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.


[Django] #24157: Prompt to add a new field after renaming

2015-01-15 Thread Django
#24157: Prompt to add a new field after renaming
+
 Reporter:  basilu  |  Owner:  nobody
 Type:  Bug | Status:  new
Component:  Migrations  |Version:  1.7
 Severity:  Normal  |   Keywords:
 Triage Stage:  Unreviewed  |  Has patch:  0
Easy pickings:  0   |  UI/UX:  0
+
 I have noticed a slightly weird logic of makemigration command after
 renaming a field in a model.py.

 So, I did this:
 1. Rename field
 from
 {{{#!python
 descr = models.TextField('description')
 }}}
 to
 {{{#!python
 description = models.TextField()
 }}}
 2. Invoke
 {{{
 manage.py makemigrations
 }}}
 And migration logic decided that I had added a new field //description//
 and asked me to provide default value.

 But if to perform renaming this way:

 from
 {{{#!python
 descr = models.TextField('description')
 }}}
 to
 {{{#!python
 description = models.TextField('description') # note a passed verbose name
 argument
 }}}
 then migration logic works well and recognizes renaming.

--
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/049.90d3e6eb083b3fd1bd26b71e22f00ac6%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.