#22741: Migrate fails with `TypeError` when using a callable default for a
`ForeignKey`
-------------------------------------+-------------------------------------
     Reporter:  rednaw               |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |               Resolution:  needsinfo
     Severity:  Normal               |             Triage Stage:
     Keywords:  migrations           |  Unreviewed
  foreignkey                         |      Needs documentation:  0
    Has patch:  0                    |  Patch needs improvement:  0
  Needs tests:  0                    |                    UI/UX:  0
Easy pickings:  0                    |
-------------------------------------+-------------------------------------
Changes (by charettes):

 * status:  new => closed
 * cc: charettes (added)
 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0
 * resolution:   => needsinfo


Comment:

 Please use the preview options before submitting a ticket -- code blocks
 should be wrapped in `{{{ }}}` in order to be displayed properly.

 Unfortunately the migration framework doesn't support `lambda`s
 deconstruction, see #21037 and #22351 for details.

 Since you seems to have another issue setting `default=first_house` we'd
 need the full `TypeError` traceback to determine if it's actually a Django
 bug.

 The fact that your `first_house` function doesn't return anything (copy-
 pasta from the `lambda`?) is a bit suspicious here.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/22741#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.115a23c0e1a52c6bfef11015394d1873%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to