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?
As of django-localflavor version 1.0, simply adding "localflavor" to your INSTALLED_APPS
is all you need to get South to properly pick it up. https://django-localflavor.readthedocs.org/en/latest/?highlight=south#installation
Have you tried adding the introspection rule?
add_introspection_rules([], ["^django_localflavor_us\.models\.USStateField"])
I had to tweak Hedde van der Heide's solution to get mine to work. It looks like this:
add_introspection_rules([], ["^localflavor\.us\.models\.USStateField"])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With