Change check for self.id to self.pk to account for cases where a custom primary key field is being used