Re: Django 1.7.6 TypeError when applying migration with ForeignKey with default

2015-03-12 Thread Collin Anderson
Hi, Maybe g() should return the id instead of the instance? That does seem a bit odd that it wouldn't accept an A() instance as the default. Collin On Wednesday, March 11, 2015 at 7:43:35 AM UTC-4, Krzysztof Ciebiera wrote: > > I have created a model A: > > def g(): > return A.objects.get(p

Django 1.7.6 TypeError when applying migration with ForeignKey with default

2015-03-11 Thread Krzysztof Ciebiera
I have created a model A: def g(): return A.objects.get(pk=1) class A(models.Model): a = models.IntegerField() ./manage.py makemigrations ./manage.py migrate then I've added some data: a = A(a=1) a.save() then I have created another model with a ForeignKey field with a default set to