Re: [Django] #24278: squashmigrations throws ValueError: need more than 1 value to unpack

2015-04-05 Thread Django
#24278: squashmigrations throws ValueError: need more than 1 value to unpack
+-
 Reporter:  riklaunim   |Owner:  knbk
 Type:  Bug |   Status:  closed
Component:  Migrations  |  Version:  1.8
 Severity:  Normal  |   Resolution:  fixed
 Keywords:  | Triage Stage:  Ready for checkin
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+-

Comment (by Markus Holtermann ):

 In [changeset:"651cc369ad803e116268c5ec7f0f8389858ae10b" 651cc369]:
 {{{
 #!CommitTicketReference repository=""
 revision="651cc369ad803e116268c5ec7f0f8389858ae10b"
 [1.8.x] Refs #24278 -- Allowed multi-line serializations in
 OperationWriter.

 Changed OperationWriter to support multi-line serialized values with
 correct indentation.

 Backport of d597174bd4cfd9a0e1b34dae8b4d8d027a8cab72 from master
 }}}

--
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/067.cad669ccd6841ba15581c5a3df6da452%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24278: squashmigrations throws ValueError: need more than 1 value to unpack

2015-04-05 Thread Django
#24278: squashmigrations throws ValueError: need more than 1 value to unpack
+-
 Reporter:  riklaunim   |Owner:  knbk
 Type:  Bug |   Status:  closed
Component:  Migrations  |  Version:  1.8
 Severity:  Normal  |   Resolution:  fixed
 Keywords:  | Triage Stage:  Ready for checkin
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+-

Comment (by Markus Holtermann ):

 In [changeset:"773387ce42de1c355e6ed6b9ddd49dc52474fc0a" 773387ce]:
 {{{
 #!CommitTicketReference repository=""
 revision="773387ce42de1c355e6ed6b9ddd49dc52474fc0a"
 [1.8.x] Fixed #24278 -- Fixed serialization of migration operations.

 Fixed MigrationWriter.serialize() to correctly handle migration
 operations by utilizing OperationWriter.

 Thanks Piotr Maliński for the report.

 Backport of e8e4f978dd4b7a3d0c689c6e3301e3c6f9e50003 from master
 }}}

--
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/067.d9ef04c993771471a13ae99df55596e0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24278: squashmigrations throws ValueError: need more than 1 value to unpack

2015-04-05 Thread Django
#24278: squashmigrations throws ValueError: need more than 1 value to unpack
+-
 Reporter:  riklaunim   |Owner:  knbk
 Type:  Bug |   Status:  assigned
Component:  Migrations  |  Version:  1.8
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Ready for checkin
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+-

Comment (by Markus Holtermann ):

 In [changeset:"d597174bd4cfd9a0e1b34dae8b4d8d027a8cab72" d597174b]:
 {{{
 #!CommitTicketReference repository=""
 revision="d597174bd4cfd9a0e1b34dae8b4d8d027a8cab72"
 Refs #24278 -- Allowed multi-line serializations in OperationWriter.

 Changed OperationWriter to support multi-line serialized values with
 correct indentation.
 }}}

--
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/067.5add4b19b84c1ed553e8faf250ea2d96%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24278: squashmigrations throws ValueError: need more than 1 value to unpack

2015-04-05 Thread Django
#24278: squashmigrations throws ValueError: need more than 1 value to unpack
+-
 Reporter:  riklaunim   |Owner:  knbk
 Type:  Bug |   Status:  closed
Component:  Migrations  |  Version:  1.8
 Severity:  Normal  |   Resolution:  fixed
 Keywords:  | Triage Stage:  Ready for checkin
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+-
Changes (by Markus Holtermann ):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"e8e4f978dd4b7a3d0c689c6e3301e3c6f9e50003" e8e4f978]:
 {{{
 #!CommitTicketReference repository=""
 revision="e8e4f978dd4b7a3d0c689c6e3301e3c6f9e50003"
 Fixed #24278 -- Fixed serialization of migration operations.

 Fixed MigrationWriter.serialize() to correctly handle migration
 operations by utilizing OperationWriter.

 Thanks Piotr Maliński for the report.
 }}}

--
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/067.9f7c0c8e1fba99f47622ef699cb8f461%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24278: squashmigrations throws ValueError: need more than 1 value to unpack

2015-04-05 Thread Django
#24278: squashmigrations throws ValueError: need more than 1 value to unpack
+-
 Reporter:  riklaunim   |Owner:  knbk
 Type:  Bug |   Status:  assigned
Component:  Migrations  |  Version:  1.8
 Severity:  Normal  |   Resolution:
 Keywords:  | Triage Stage:  Ready for checkin
Has patch:  1   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+-
Changes (by MarkusH):

 * needs_better_patch:  1 => 0
 * version:  1.7 => 1.8
 * stage:  Accepted => Ready for checkin


--
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/067.486687ce3b3690155a97179d6676ca7d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24278: squashmigrations throws ValueError: need more than 1 value to unpack

2015-04-02 Thread Django
#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
+
Changes (by mvantellingen):

 * cc: michaelvantellingen@… (added)


--
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/067.01a2d21c40f0f9f32ca19eab3a68e06a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24278: squashmigrations throws ValueError: need more than 1 value to unpack

2015-03-30 Thread Django
#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
+
Changes (by timgraham):

 * needs_better_patch:  0 => 1


Comment:

 Markus reviewed the PR.

--
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/067.1cf00c14fd349cf1672c464dc912ec9a%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24278: squashmigrations throws ValueError: need more than 1 value to unpack

2015-03-16 Thread Django
#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:  0
Easy pickings:  0   |UI/UX:  0
+
Changes (by knbk):

 * needs_better_patch:  1 => 0


--
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/067.b994e2a1edebab79f7dd46caccc64804%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24278: squashmigrations throws ValueError: need more than 1 value to unpack

2015-02-08 Thread Django
#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: 
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/067.781d596f116a72a792026289e19e31d0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24278: squashmigrations throws ValueError: need more than 1 value to unpack

2015-02-07 Thread Django
#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
+
Changes (by MarkusH):

 * cc: MarkusH (added)
 * needs_better_patch:  0 => 1


Comment:

 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.

--
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/067.df686ffe7c7ebe1d072b5b0a4e51da20%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24278: squashmigrations throws ValueError: need more than 1 value to unpack

2015-02-06 Thread Django
#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:  0
Easy pickings:  0   |UI/UX:  0
+
Changes (by knbk):

 * has_patch:  0 => 1


Comment:

 PR: https://github.com/django/django/pull/4075

 `MigrationsWriter._serialize_path()` now checks if there is a dot in the
 path, and if there isn't, assumes it is a class in `django.db.migrations`.
 As this module is always imported in generated migrations, I changed the
 imports to an empty dict and the name to `migrations.`.

 This bug was caused by the fact that `Operation.deconstruct()` returns the
 class name as the first value instead of the full import path.

--
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/067.6aa3954301a88daf1e9091a5f3bf8826%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24278: squashmigrations throws ValueError: need more than 1 value to unpack

2015-02-06 Thread Django
#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:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+

Comment (by knbk):

 Failing test case:

 {{{
 diff --git a/tests/migrations/test_writer.py
 b/tests/migrations/test_writer.py
 index 38065fb..4130e32 100644
 --- a/tests/migrations/test_writer.py
 +++ b/tests/migrations/test_writer.py
 @@ -346,6 +346,18 @@ class WriterTests(TestCase):
  self.assertSerializedEqual(FoodManager('a', 'b'))
  self.assertSerializedEqual(FoodManager('x', 'y', c=3, d=4))

 +def test_serialize_operation(self):
 +"""
 +Tests serializing an operation with MigrationWriter serialize.
 This happens when
 +serializing an operation within an operation, e.g. with
 SeparateDatabaseAndState.
 +"""
 +operation = migrations.RenameField(
 +model_name="SomeModel",
 +old_name="old_name",
 +new_name="new_name",
 +)
 +self.assertSerializedEqual(operation)
 +
  def test_simple_migration(self):
  """
  Tests serializing a simple migration.
 }}}

--
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/067.e1a20151ab05b51c26f09413853638d8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #24278: squashmigrations throws ValueError: need more than 1 value to unpack

2015-02-06 Thread Django
#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:  0   |  Needs documentation:  0
  Needs tests:  0   |  Patch needs improvement:  0
Easy pickings:  0   |UI/UX:  0
+
Changes (by knbk):

 * status:  new => assigned
 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * owner:  nobody => knbk
 * needs_docs:   => 0
 * stage:  Unreviewed => Accepted


Comment:

 Confirmed, working on this now.

--
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/067.77a0de276b9b6f82a3e90bd5df7a0366%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #24278: squashmigrations throws ValueError: need more than 1 value to unpack

2015-02-04 Thread Django
#24278: squashmigrations throws ValueError: need more than 1 value to unpack
+
 Reporter:  riklaunim   |  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
+
 When squashing several migrations I got an exception during
 squashmigrations:
 {{{
 Traceback (most recent call last):
   File "/env/bin/django-admin.py", line 5, in 
 management.execute_from_command_line()
   File "/env/lib/python3.4/site-
 packages/django/core/management/__init__.py", line 385, in
 execute_from_command_line
 utility.execute()
   File "/env/lib/python3.4/site-
 packages/django/core/management/__init__.py", line 377, in execute
 self.fetch_command(subcommand).run_from_argv(self.argv)
   File "/env/lib/python3.4/site-packages/django/core/management/base.py",
 line 288, in run_from_argv
 self.execute(*args, **options.__dict__)
   File "/env/lib/python3.4/site-packages/django/core/management/base.py",
 line 338, in execute
 output = self.handle(*args, **options)
   File "/env/lib/python3.4/site-
 packages/django/core/management/commands/squashmigrations.py", line 122,
 in handle
 fh.write(writer.as_string())
   File "/env/lib/python3.4/site-packages/django/db/migrations/writer.py",
 line 130, in as_string
 operation_string, operation_imports =
 OperationWriter(operation).serialize()
   File "/env/lib/python3.4/site-packages/django/db/migrations/writer.py",
 line 87, in serialize
 arg_string, arg_imports = MigrationWriter.serialize(arg_value)
   File "/env/lib/python3.4/site-packages/django/db/migrations/writer.py",
 line 260, in serialize
 item_string, item_imports = cls.serialize(item)
   File "/env/lib/python3.4/site-packages/django/db/migrations/writer.py",
 line 327, in serialize
 return cls.serialize_deconstructed(*value.deconstruct())
   File "/env/lib/python3.4/site-packages/django/db/migrations/writer.py",
 line 223, in serialize_deconstructed
 module, name = path.rsplit(".", 1)
 ValueError: need more than 1 value to unpack
 }}}

 The "path" variable got a value of "RenameField" instead of
 django.something.someField. I found one "migrations.RenameField" in the
 migrations set and after removing it (and "migrations.AlterField" which
 also caused such exception) the squash passed.

 The migration (operations) with those fields looks like so:

 {{{
 operations = [
 migrations.SeparateDatabaseAndState(state_operations=[
 migrations.RenameField(
 model_name='somemodel',
 old_name='some_old_name',
 new_name='new_name',
 ),
 migrations.AlterField(
 model_name='somemodel',
 name='new_name',
 field=models.BooleanField(db_column='some_old_name',
 default=False),
 preserve_default=True,
 ),
 ]),
 ]
 }}}

--
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/052.6ccc894a8000f56917f5266aa403bdb2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.