Django 1.8 data migrations not able to locate related collections

45 views
Skip to first unread message

A Lee

unread,
Apr 16, 2015, 8:52:26 PM4/16/15
to django...@googlegroups.com
Hello,

After upgrading to 1.8 from 1.7.7 our tests are now unable to create test data via data migrations and complain about related collections not existing as attributes for some but not all models (exception stack trace at https://travis-ci.org/virtualcommons/vcweb). It appears to succeed at creating a model object for the first related collection but then dies when attempting to create objects in the second related collection (https://github.com/virtualcommons/vcweb/blob/develop/vcweb/experiment/forestry/migrations/0001_initial_forestry.py#L62). 

Any ideas on what might be causing this? Access to related collections through the django shell and via the web interface still seem to be working fine on 1.8, it's just the data migrations that are failing.

Pavel Kuchin

unread,
Apr 17, 2015, 7:14:39 AM4/17/15
to django...@googlegroups.com
Hi A Lee,

And based on django documentation the related_name must always be unique (https://docs.djangoproject.com/en/1.8/topics/db/models/#be-careful-with-related-name)

It is just an assumption.

Yours sincerely,
Pavel

Pavel Kuchin

unread,
Apr 17, 2015, 7:28:13 AM4/17/15
to django...@googlegroups.com

Markus Holtermann

unread,
Apr 17, 2015, 12:45:08 PM4/17/15
to django...@googlegroups.com
Hi A Lee,

I think I've seen that one before. Can you check if the fix for https://code.djangoproject.com/ticket/24573 resolves the issue?

/Markus

A Lee

unread,
Apr 17, 2015, 6:48:12 PM4/17/15
to django...@googlegroups.com
Hi Markus, thanks for the fast response! Yup, that did the trick. I had to do some manual copypasta into the stable/1.8.x branch to get it to run but it appears that was the issue.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/bbb334b8-6d77-4954-9bb9-800fef266a10%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages