Use bool(self.parent_id) instead of > 0