[Django]-South ValueError: Cannot successfully create field for model: 'module' object has no attribute <CustomClassAttributeHere>

5๐Ÿ‘

โœ…

So, here is what Iโ€™ve figured:

the code is fine and the issue is caused by a bit of refactoring I did (the custom field class was originally sitting inside tools module and I wanted it to sit within all the other models and stuff).

Migrations file had this string:

('completion', self.gf('core.tools.IntegerRangeField')(default=0, blank=True)),

and I think this has messed up South in some sort of way to keep looking for core.tools.IntegerRangeField whilst it wasnโ€™t there any more.

I put IntegerRangeField back inside tools.py and it all worked out. Weird.

๐Ÿ‘คabolotnov

0๐Ÿ‘

In the last migration for you app, if you change

('completion', self.gf('core.tools.IntegerRangeField')(default=0, blank=True)),

to

('completion', self.gf('newpackage.newmodule.IntegerRangeField')(default=0, blank=True)),

Then your migrations will start working again

๐Ÿ‘คMarc

Leave a comment