def get_by_id(self, pk): cur = self.conn.cursor() alumno = cur.execute("SELECT * FROM {} WHERE {} = {}".format( self.table, self.PK_FIELD, pk)).fetchone() cur.close() return Alumno.from_row(alumno)
def get_all(self): return [Alumno.from_row(row) for row in super().get_all()]