#26385: Squash migrations with Python 3.4 creates broken migrations
----------------------------+--------------------
     Reporter:  brian       |      Owner:  nobody
         Type:  Bug         |     Status:  new
    Component:  Migrations  |    Version:  1.9
     Severity:  Normal      |   Keywords:
 Triage Stage:  Unreviewed  |  Has patch:  0
Easy pickings:  0           |      UI/UX:  0
----------------------------+--------------------
 In attempting a work around for #26384 by squashing the commits, I found
 another problem:

 {{{
 E           AssertionError: ManyToManyField(b'spud.album') is invalid.
 First parameter to ManyToManyField must be either a model, a model name,
 or the string 'self'
 }}}

 I believe the problem is that it used a byte value instead of a string.

 {{{
         migrations.AddField(
             model_name='photo',
             name='albums',
             field=models.ManyToManyField(related_name='photos',
 through='spud.photo_album', to=b'spud.album'),
         ),
 }}}

 This works fine with Python 2.7 but not with Python 3.4.

 The original before squashing was ok:

 {{{
         migrations.AddField(
             model_name='photo',
             name='albums',
             field=models.ManyToManyField(related_name='photos',
 through='spud.photo_album', to='spud.album'),
             preserve_default=True,
         ),
 }}}

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

Reply via email to