def delete(self) :
        "deletes the document from the database"
        if self.URL is None :
            raise DeletionError("Can't delete a document that was not saved")
        r = self.connection.session.delete(self.URL)
        data = r.json()

        if (r.status_code != 200 and r.status_code != 202) or 'error' in data :
            raise DeletionError(data['errorMessage'], data)
        self.reset(self.collection)

        self.modified = True
def delete ( self ) : if self . URL is None : raise DeletionError ( "Can't delete a document that was not saved" ) r = self . connection . session . delete ( self . URL ) data = r . json ( ) if ( r . status_code != 200 and r . status_code != 202 ) or 'error' in data : raise DeletionError ( data [ 'errorMessage' ] , data ) self . reset ( self . collection ) self . modified = True
deletes the document from the database