How to fix Django South issue with regards to localflavor in Django 1.5?

django, django-localflavor, django-south

Solution

Have you tried adding the introspection rule?

add_introspection_rules([], ["^django_localflavor_us\.models\.USStateField"])

Problem

I'm starting a new project and I'm using Django 1.5. I found out that the localflavor stuff has been removed from Django 1.5 and is now a separate installable package. So I installed it. In my models.py I'm importing the U.S. localflavors to get my states: ``` from django_localflavor_us.models import USStateField ``` In my model, I have this field: ``` state = USStateField(default='VA') ``` When I attempt to run a migration with South, I get the following message now: ! Cannot freeze field 'playerstats.location.state' ! (this field has class django_localflavor_us.models.USStateField) ! South cannot introspect some fields; this is probably because they are custom ! fields. If they worked in 0.6 or below, this is because we have removed the ! models parser (it often broke things). ! To fix this, read http://south.aeracode.org/wiki/MyFieldsDontWork I read through the wiki article, but I find it very verbose and complex. My USStateField isn't considered a custom field now in 1.5 is it? Has anyone else run into this issue in 1.5? And how did you resolve it?

Original source