changed self.delete to self.delete_key in base_document and document

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
```