Re: [Django] #24303: Not all models available in custom data migration

2015-02-12 Thread Django
#24303: Not all models available in custom data migration
-+--
 Reporter:  grandfatha   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:  worksforme
 Keywords:  data migrations  | Triage Stage:  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--

Comment (by grandfatha):

 Oh god that was a bad idea. If anyone ever reads this: Use a real
 migration instead of "__first__" if your data migration requires fields
 that will be added after "__first__". It might sound nice to not depend on
 a specific version, but it can cause failure.

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


Re: [Django] #24303: Not all models available in custom data migration

2015-02-12 Thread Django
#24303: Not all models available in custom data migration
-+--
 Reporter:  grandfatha   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:  worksforme
 Keywords:  data migrations  | Triage Stage:  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--

Comment (by grandfatha):

 When trying this within my app, I got:

   File ".../site-packages/django/db/migrations/graph.py", line 46, in
 add_dependency
 "Migration %s dependencies reference nonexistent parent node %r" %
 (migration, parent)
 KeyError: u"Migration items.0006_auto_20150212_1138 dependencies reference
 nonexistent parent node (u'attributes', u'0001_initial.py')"


 I changed it to:

 {{{

 class Migration(migrations.Migration):

 dependencies = [
 ('items', '0005_probe_is_active'),
 ('attributes', '__first__'),
 ('actions', '__first__'),
 ]

 operations = [
migrations.RunPython(code=forwards)
 ]

 }}}

 Then it worked.

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


Re: [Django] #24303: Not all models available in custom data migration

2015-02-12 Thread Django
#24303: Not all models available in custom data migration
-+--
 Reporter:  grandfatha   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:  worksforme
 Keywords:  data migrations  | Triage Stage:  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--

Comment (by grandfatha):

 Thank you for your input!

 So I should depend on the first or latest migration of all the apps that I
 use?

 In the case as described above, would as shown below be the correct way to
 go?

 {{{
 class Migration(migrations.Migration):

 dependencies = [
 ('items','0001_initial.py'),
 ('attributes','0001_initial.py'),
 ('actions','0001_initial.py'),
 ]

 operations = [
 migrations.RunPython(code=forwards)
 ]

 }}}

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


Re: [Django] #24303: Not all models available in custom data migration

2015-02-08 Thread Django
#24303: Not all models available in custom data migration
-+--
 Reporter:  grandfatha   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Migrations   |  Version:  1.7
 Severity:  Normal   |   Resolution:  worksforme
 Keywords:  data migrations  | Triage Stage:  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+--
Changes (by knbk):

 * status:  new => closed
 * needs_better_patch:   => 0
 * resolution:   => worksforme
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 It works fine for me. Make sure your custom migration has all the apps
 that you use in your `RunPython` function listed in its dependencies, or
 the app indeed won't be loaded.

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