#24278: squashmigrations throws ValueError: need more than 1 value to unpack ----------------------------+------------------------------------ Reporter: riklaunim | Owner: knbk Type: Bug | Status: assigned Component: Migrations | Version: 1.7 Severity: Normal | Resolution: Keywords: | Triage Stage: Accepted Has patch: 1 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 1 Easy pickings: 0 | UI/UX: 0 ----------------------------+------------------------------------
Comment (by knbk): Replying to [comment:4 MarkusH]: > I don't think this is the way to go. I'd prefer to find a way to use the `django.db.migrations.writer.OperationWriter` instead. This would also take care of indenting the respective output. Yes, that indeed seems to be a better approach. I've pushed a new patch that uses the `OperationWriter` instead. ([https://github.com/django/django/pull/4075 PR]) I think I'm gonna try to refactor this so that the `isinstance(value, Operation)` check is moved to `MigrationWriter.serialize()`. This would leave the `_write` function in `OperationWriter.serialize()` as a more general function, while `MigrationWriter.serialize()` handles the value- specific serialization. `_write` would still need to be able to handle multi-line values, but this also opens up the possibility for other objects to serialize into a multi-line string. -- Ticket URL: <https://code.djangoproject.com/ticket/24278#comment:5> 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 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/067.781d596f116a72a792026289e19e31d0%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.