DocPerm has a field called 'delete'. This clashes with the function name. Leads to this error: self.delete("__in_insert") TypeError: 'int' object is not callable