def _delete(self, pk):
item = self.datamodel.get(pk, self._base_filters)<EOL>if not item:<EOL><INDENT>abort(<NUM_LIT>)<EOL><DEDENT>try:<EOL><INDENT>self.pre_delete(item)<EOL><DEDENT>except Exception as e:<EOL><INDENT>flash(str(e), "<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>if self.datamodel.delete(item):<EOL><INDENT>self.post_delete(item)<EOL><DEDENT>flash(*self.datamodel.message)<EOL>self.update_redirect()<EOL><DEDENT>
Delete function logic, override to implement different logic
deletes the record with primary_key = pk

:param pk:
    record primary key to delete