def find(self, clinic_id): c = self._conn.cursor() c.execute( """ SELECT id FROM clinics WHERE id = ? """, [clinic_id]) return DTO.clinics(*c.fetchone())
def populate_db(self, vacs, sups, clis, logs): for i in vacs: i = i.split(',') vaccine = DTO.vaccines(*i) insert_vac = DAO._vaccines(self._conn) insert_vac.insert(vaccine) for i in sups: i = i.split(',') supplier = DTO.suppliers(*i) insert_sup = DAO._suppliers(self._conn) insert_sup.insert(supplier) for i in clis: i = i.split(',') clinic = DTO.clinics(*i) insert_clinic = DAO._clinics(self._conn) insert_clinic.insert(clinic) for i in logs: i = i.split(',') logistic = DTO.logistics(*i) insert_logistic = DAO._logistics(self._conn) insert_logistic.insert(logistic)