#22351: New django migrations and places where lambdas are supposed
--------------------------------------+------------------------------------
     Reporter:  dimyur27@…            |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  Migrations            |                  Version:  master
     Severity:  Normal                |               Resolution:
     Keywords:  migrations lambdas    |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------

Comment (by chriscauley):

 This is a similar problem to tickets #22373 and #22436 and loosely related
 to a few others. In #22436 we discovered that if we do
 `limit_choices_to=module.some_function`, migrations will break in the
 event that module.some_function is deleted, changed, renamed, or moved.
 This makes migrations not future safe. I'm pretty new to django
 migrations, but I know with south the overall goal was to have previous
 migrations not rely on the contemporary state of models.py for this very
 reason.

 Is the `limit_choices_to` function even used in migrations? If we make the
 `Field.deconstruct()` method return a function that raises a
 NotImplementedError when called then it wouldn't mind the lambda. It would
 also be future safe in the event that the function provided is renamed or
 changed in a way that no longer reflects the code. I'll make a patch to
 reflect this change.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/22351#comment:2>
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/076.cc352919518e36db797488656e2ef437%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to