Re: Migration Woes: TypeError: int() argument must be a string... on ForeignKeys

2017-09-13 Thread Melvyn Sopacua
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

RE: Migration Woes: TypeError: int() argument must be a string... on ForeignKeys

2017-09-13 Thread Matthew Pava
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