@expose("<STR_LIT>", methods=["<STR_LIT>"])<EOL><INDENT>@protect()<EOL>@safe<EOL>@permission_name("<STR_LIT>")<EOL>def delete(self, pk):<DEDENT>
item = self.datamodel.get(pk, self._base_filters)<EOL>if not item:<EOL><INDENT>return self.response_404()<EOL><DEDENT>self.pre_delete(item)<EOL>try:<EOL><INDENT>self.datamodel.delete(item, raise_exception=True)<EOL>self.post_delete(item)<EOL>return self.response(<NUM_LIT:200>, message="<STR_LIT:OK>")<EOL><DEDENT>except IntegrityError as e:<EOL><INDENT>return self.response_422(message=str(e.orig))<EOL><DEDENT>
Delete item from Model
        ---
        delete:
          parameters:
          - in: path
            schema:
              type: integer
            name: pk
          responses:
            200:
              description: Item deleted
              content:
                application/json:
                  schema:
                    type: object
                    properties:
                      message:
                        type: string
            404:
              $ref: '#/components/responses/404'
            422:
              $ref: '#/components/responses/422'
            500:
              $ref: '#/components/responses/500'