I changed a field from CharField to ForeignKey on a Model called Availability, when I am trying to migrate I keep getting the error below:
ValueError: Lookup failed for model referenced by field reservation.Availability.location: useraccount.Location
Any idea why this could be happening?
Thanks
--------------UPDATED CODE--------------
App: reservation
from useraccount.models import Location
class Availability(models.Model):
location = models.ForeignKey(Location)
App: useraccount
class Location(models.Model):
town = models.CharField(max_length=100)
county = models.CharField(max_length=100)
def __str__(self):
return self.town + ', ' + self.county
Stacktrace
System check identified some issues:
WARNINGS: notification.NoticeSetting.send: (1_6.W002) BooleanField does not have a default value. HINT: Django 1.6 changed the default value of BooleanField from False to None. See https://docs.djangoproject.com/en/1.6/ref/models/fields/#booleanfield for more information. Operations to perform: Apply all migrations: reservation Running migrations: Applying reservation.0010_auto_20141210_0357...Traceback (most recent call last): File "/Users/chirdeeptomar/envs/mydocbook/lib/python3.4/site-packages/django/apps/registry.py", line 148, in get_app_config return self.app_configs[app_label] KeyError: 'useraccount'
During handling of the above exception, another exception occurred: