So I’m building a Django application,
and these are a few models I have:
class MagicType(models.Model):
name = models.CharField(max_length=155)
parent = models.ForeignKey('self', null=True, blank=True)
class Spell(models.Model):
name = models.CharField(max_length=250, db_index=True)
magic_words = models.CharField(max_length=250, db_index=True)
magic_types = models.ManyToManyField(MagicType)
When syncing the models I’m getting this error:
AttributeError: 'ManyToManyField' object has no attribute '_get_m2m_column_name'
Is there a reason this is happening? How can I fix this?
Help would be very much appreciated.
EDIT:
I’m using django-evolution http://code.google.com/p/django-evolution/
I suggest you use django-extensions , this will give you a commnad
sqldiiffthat works better than evolution, because there is a problem creating the intermediate table between MagicType and MagicType.I suggest you run the command
sqlall yourappand execute directly the sql code of the creation of the new intermediate table. Evolution doesn’t it for you 🙁