The issue didn't crop up, because there were no rows when you added
the field, so default isn't called. If you had existing data, then it
would've triggered.
What default should return for foreign keys is actually documented:
> For fields like ForeignKey that map to model instances, defaults shou
Okay, after much investigation, I found that the default value on this exact
field was actually a callable that returned an instance of DisplayName rather
than the pk. After changing that, the migrations ran successfully. I wonder
if Django could provide a better hint of such issues. It’s str
2 matches
Mail list logo