def delete_item(self, item):
        ''' removes an item from the db '''
        for relation in self.relations_of(item):
            self.delete_relation(item, relation)
        for origin, relation in self.relations_to(item, True):
            self.delete_relation(origin, relation, item)
        with self._write_lock:
            self._execute('''
                DELETE from objects where code=?
            ''', (self.serialize(item),))
            self.autocommit()
def delete_item ( self , item ) : for relation in self . relations_of ( item ) : self . delete_relation ( item , relation ) for origin , relation in self . relations_to ( item , True ) : self . delete_relation ( origin , relation , item ) with self . _write_lock : self . _execute ( '''
                DELETE from objects where code=?
            ''' , ( self . serialize ( item ) , ) ) self . autocommit ( )
removes an item from the db