10👍
✅
The problem is that accessing the FK itself causes a database lookup, which is failing. To avoid that, access the underlying ID field:
if self.parent_id is None:
Source:stackexchange.com
10👍
The problem is that accessing the FK itself causes a database lookup, which is failing. To avoid that, access the underlying ID field:
if self.parent_id is None: