def delete(self, objID):
     Repository.delete(self, objID)
     current = self._connection.cursor()
     sql = 'DELETE FROM grades WHERE id = ?'
     current = self._connection.cursor()
     current.execute(sql, (objID, ))
     self._connection.commit()
Beispiel #2
0
 def test_remove(self):
     studs = Repository([])
     studs.store(s1 := Student(1234, 'John Doe', 1))
     self.assertNotEqual(str(studs), '\n')
     studs.delete(1234)
     self.assertEqual(len(studs), 0)
     with self.assertRaises(RepositoryException):
         studs.delete(s1.Id)
Beispiel #3
0
 def delete(self, objID):
     Repository.delete(self, objID)
     self._saveFile()
 def delete(self, objID):
     r = Repository.delete(self, objID)
     self._saveFile()
     return r